aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-power.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-10-26 18:04:43 +0200
committerCharles Kerr <charles.kerr@canonical.com>2012-10-26 18:04:43 +0200
commit0189c72f5650e4d3ff605bd359e99b2ad1d06a3f (patch)
tree916531cba10ceb2cd1949ab344e99c4519f8c1cc /src/indicator-power.c
parentcd8e633cc850d0c9f1bc16533d5962cdfda16856 (diff)
downloadayatana-indicator-power-0189c72f5650e4d3ff605bd359e99b2ad1d06a3f.tar.gz
ayatana-indicator-power-0189c72f5650e4d3ff605bd359e99b2ad1d06a3f.tar.bz2
ayatana-indicator-power-0189c72f5650e4d3ff605bd359e99b2ad1d06a3f.zip
fix logic error when deciding which primary device to select.
Diffstat (limited to 'src/indicator-power.c')
-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..8da9734 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) /* b is charging */
{
ret = -1;
}