aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-10-29 11:17:19 +0000
committerTarmac <Unknown>2012-10-29 11:17:19 +0000
commit1e5b83de6bb681307aababbbdc1492e53885b843 (patch)
treeec2507cf9a197f14da8bdb8125943f2e2b117062 /src
parent6d19670d7d438f2c58c9d819e87b72060af16bc5 (diff)
parent7d558ffe8277e88dab2c4367b496fbf98a257cc1 (diff)
downloadayatana-indicator-power-1e5b83de6bb681307aababbbdc1492e53885b843.tar.gz
ayatana-indicator-power-1e5b83de6bb681307aababbbdc1492e53885b843.tar.bz2
ayatana-indicator-power-1e5b83de6bb681307aababbbdc1492e53885b843.zip
Fix the logic error. Add tests to confirm the fix. Fixes: https://bugs.launchpad.net/bugs/1071757.
Approved by Lars Uebernickel, PS Jenkins bot.
Diffstat (limited to 'src')
-rw-r--r--src/indicator-power.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/indicator-power.c b/src/indicator-power.c
index 852ccd5..4118dcc 100644
--- a/src/indicator-power.c
+++ b/src/indicator-power.c
@@ -399,11 +399,11 @@ device_compare_func (gconstpointer ga, gconstpointer gb)
state = UP_DEVICE_STATE_CHARGING;
if (!ret && (((a_state == state) && a_time) || ((b_state == state) && b_time)))
{
- if (b_state != state) /* a is charging */
+ if (a_state != state) /* b is charging */
{
ret = 1;
}
- if (a_state != state) /* b is charging */
+ else if (b_state != state) /* a is charging */
{
ret = -1;
}