From 6b553ec7de3fdd81d0522d299a1e1b9c046d0ed2 Mon Sep 17 00:00:00 2001 From: Toni Spets Date: Tue, 7 Aug 2007 23:18:02 +0000 Subject: [PATCH] Added spacer for wireless variables. Fixed some tabs. Disabled old wireless code. git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@900 7f574dfc-610e-0410-a909-a81674777703 --- src/conky.c | 15 ++++++++++++--- src/linux.c | 7 +++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/conky.c b/src/conky.c index 8d9331ac..0dce9b55 100644 --- a/src/conky.c +++ b/src/conky.c @@ -3552,13 +3552,22 @@ static void generate_text_internal(char *p, int p_max_size, struct text_object * snprintf(p, p_max_size, "%s", obj->data.net->ap); } OBJ(wireless_link_qual) { - snprintf(p, p_max_size, "%d", obj->data.net->link_qual); + if (!use_spacer) + snprintf(p, p_max_size, "%d", obj->data.net->link_qual); + else + snprintf(p, 3, "%d ", obj->data.net->link_qual); } OBJ(wireless_link_qual_max) { - snprintf(p, p_max_size, "%d", obj->data.net->link_qual_max); + if (!use_spacer) + snprintf(p, p_max_size, "%d", obj->data.net->link_qual_max); + else + snprintf(p, 3, "%d ", obj->data.net->link_qual_max); } OBJ(wireless_link_qual_perc) { - snprintf(p, p_max_size, "%.0f%%", (double)obj->data.net->link_qual / obj->data.net->link_qual_max * 100); + if (!use_spacer) + snprintf(p, p_max_size, "%.0f%%", (double)obj->data.net->link_qual / obj->data.net->link_qual_max * 100); + else + snprintf(p, 4, "%.0f%% ", (double)obj->data.net->link_qual / obj->data.net->link_qual_max * 100); } OBJ(wireless_link_bar) { new_bar(p, obj->a, obj->b, ((double)obj->data.net->link_qual/obj->data.net->link_qual_max)*255.0); diff --git a/src/linux.c b/src/linux.c index c1a6f206..9ed33919 100644 --- a/src/linux.c +++ b/src/linux.c @@ -216,13 +216,13 @@ inline void update_net_stats() /* if recv or trans is less than last time, an overflow happened */ if (r < ns->last_read_recv) - last_recv = 0; + last_recv = 0; else ns->recv += (r - ns->last_read_recv); ns->last_read_recv = r; if (t < ns->last_read_trans) - last_trans = 0; + last_trans = 0; else ns->trans += (t - ns->last_read_trans); ns->last_read_trans = t; @@ -333,6 +333,8 @@ inline void update_net_stats() info.mask |= (1 << INFO_NET); } +#if 0 +/* deprecated */ inline void update_wifi_stats() { /** wireless stats patch by Bobby Beckmann **/ @@ -380,6 +382,7 @@ inline void update_wifi_stats() /*** end wireless patch ***/ } +#endif int result;