wok-stable annotate lxpanel/stuff/battery.patch @ rev 6590
Added battery patch to lxpanel to fix 100% battery power bug.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Sat Oct 09 04:48:51 2010 +0000 (2010-10-09) |
parents | |
children |
rev | line source |
---|---|
slaxemulator@6590 | 1 --- lxpanel-0.5.5/src/plugins/batt/batt_sys.c Sat Feb 6 20:45:38 2010 |
slaxemulator@6590 | 2 +++ lxpanel-0.5.5-orig/src/plugins/batt/batt_sys.c Sat Jul 24 18:48:20 2010 |
slaxemulator@6590 | 3 @@ -38,6 +38,13 @@ |
slaxemulator@6590 | 4 battery* battery_new() { |
slaxemulator@6590 | 5 static int battery_num = 1; |
slaxemulator@6590 | 6 battery * b = g_new0 ( battery, 1 ); |
slaxemulator@6590 | 7 + battery_reset(b); |
slaxemulator@6590 | 8 + b->battery_num = battery_num; |
slaxemulator@6590 | 9 + battery_num++; |
slaxemulator@6590 | 10 + return b; |
slaxemulator@6590 | 11 + } |
slaxemulator@6590 | 12 + |
slaxemulator@6590 | 13 +void battery_reset( battery * b) { |
slaxemulator@6590 | 14 b->type_battery = TRUE; |
slaxemulator@6590 | 15 b->capacity_unit = "mAh"; |
slaxemulator@6590 | 16 b->last_capacity_unit = -1; |
slaxemulator@6590 | 17 @@ -49,9 +56,6 @@ |
slaxemulator@6590 | 18 b->remaining_capacity = -1; |
slaxemulator@6590 | 19 b->present_rate = -1; |
slaxemulator@6590 | 20 b->state = NULL; |
slaxemulator@6590 | 21 - b->battery_num = battery_num; |
slaxemulator@6590 | 22 - battery_num++; |
slaxemulator@6590 | 23 - return b; |
slaxemulator@6590 | 24 } |
slaxemulator@6590 | 25 |
slaxemulator@6590 | 26 |
slaxemulator@6590 | 27 @@ -136,6 +140,8 @@ |
slaxemulator@6590 | 28 }; |
slaxemulator@6590 | 29 const gchar *sys_file; |
slaxemulator@6590 | 30 |
slaxemulator@6590 | 31 + battery_reset(b); |
slaxemulator@6590 | 32 + |
slaxemulator@6590 | 33 while ( (sys_file = sys_list[i]) != NULL ) { |
slaxemulator@6590 | 34 |
slaxemulator@6590 | 35 gchar *file_content; |
slaxemulator@6590 | 36 @@ -150,7 +156,7 @@ |
slaxemulator@6590 | 37 b->state = "available"; |
slaxemulator@6590 | 38 } |
slaxemulator@6590 | 39 else if ( strcmp("energy_now", sys_file ) == 0 ) { |
slaxemulator@6590 | 40 - b->remaining_capacity = get_unit_value((gchar*) file_content) / 1000; |
slaxemulator@6590 | 41 + b->remaining_energy = get_unit_value((gchar*) file_content) / 1000; |
slaxemulator@6590 | 42 if (!b->state) |
slaxemulator@6590 | 43 b->state = "available"; |
slaxemulator@6590 | 44 } |