From 58616644d454f124522b82a55337d4fe16ece88c Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Thu, 28 Oct 2010 13:40:43 +0000 Subject: [PATCH] Attempting to implement charging status on Linux (APM) --- src/applets/battery.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/applets/battery.c b/src/applets/battery.c index bcd368b..ed83c0a 100644 --- a/src/applets/battery.c +++ b/src/applets/battery.c @@ -12,8 +12,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -/* TODO: - * - charging mode on Linux (apm) */ @@ -322,8 +320,8 @@ static gdouble _battery_get(Battery * battery, gboolean * charging) return 0.0 / 0.0; } buf[--buf_cnt] = '\0'; - if(sscanf(buf, "%lf %lf %x %x %x %x %d%% %d min", &d, &d, &u, &u, &u, - &u, &b, &i) != 8) + if(sscanf(buf, "%lf %lf %x %x %x %x %d%% %d min", &d, &d, charging, &u, + &u, &u, &b, &i) != 8) { error_set("%s: %s", apm, strerror(errno)); d = 0.0 / 0.0; @@ -350,7 +348,7 @@ static gdouble _battery_get(Battery * battery, gboolean * charging) static gboolean _on_timeout(gpointer data) { Battery * battery = data; - gboolean charging; + gboolean charging = FALSE; gdouble value; value = _battery_get(battery, &charging);