mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 02:55:12 +00:00
top: convert to callbacks.print
This commit is contained in:
parent
1832cf79c9
commit
0188eb0aaa
13
src/conky.c
13
src/conky.c
@ -1492,19 +1492,6 @@ void generate_text_internal(char *p, int p_max_size,
|
||||
}
|
||||
#endif /* XMMS */
|
||||
|
||||
/* we have four different types of top (top, top_mem,
|
||||
* top_time and top_io). To avoid having almost-same code four
|
||||
* times, we have this special handler. */
|
||||
#ifdef __linux__
|
||||
break;
|
||||
case OBJ_top:
|
||||
case OBJ_top_mem:
|
||||
case OBJ_top_time:
|
||||
#ifdef IOSTATS
|
||||
case OBJ_top_io:
|
||||
#endif
|
||||
print_top(obj, p, p_max_size);
|
||||
#endif /* __linux__ */
|
||||
#ifdef HAVE_ICONV
|
||||
OBJ(iconv_start) {
|
||||
do_iconv_start(obj);
|
||||
|
@ -643,12 +643,15 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
|
||||
/* we have four different types of top (top, top_mem, top_time and top_io). To
|
||||
* avoid having almost-same code four times, we have this special
|
||||
* handler. */
|
||||
/* XXX: maybe fiddle them apart later, as print_top() does
|
||||
* nothing else than just that, using an ugly switch(). */
|
||||
if (strncmp(s, "top", 3) == EQUAL) {
|
||||
add_update_callback(&update_meminfo);
|
||||
add_update_callback(&update_top);
|
||||
if (!parse_top_args(s, arg, obj)) {
|
||||
return NULL;
|
||||
}
|
||||
obj->callbacks.print = &print_top;
|
||||
} else OBJ(addr, &update_net_stats)
|
||||
parse_net_stat_arg(obj, arg, free_at_crash);
|
||||
obj->callbacks.print = &print_addr;
|
||||
|
Loading…
Reference in New Issue
Block a user