aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2015-01-30 11:58:57 -0600
committerCharles Kerr <charles.kerr@canonical.com>2015-01-30 11:58:57 -0600
commit6057cd8dfac7ce74facf8ccf5da052097a70e274 (patch)
tree3cf3ec9ae5ce52618264005061c62967ec8a0f90 /src
parent32b591d59deddb6dc46fdd14d8fe5be4a5e6dd4f (diff)
downloadayatana-indicator-power-6057cd8dfac7ce74facf8ccf5da052097a70e274.tar.gz
ayatana-indicator-power-6057cd8dfac7ce74facf8ccf5da052097a70e274.tar.bz2
ayatana-indicator-power-6057cd8dfac7ce74facf8ccf5da052097a70e274.zip
in the new device-state action state, use the string 'unknown' if no primary device is found.
Diffstat (limited to 'src')
-rw-r--r--src/service.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/service.c b/src/service.c
index 733f7ce..fc07619 100644
--- a/src/service.c
+++ b/src/service.c
@@ -290,14 +290,14 @@ static GVariant *
calculate_device_state_action_state (IndicatorPowerService * self)
{
const priv_t * const p = self->priv;
- const char * str;
+ UpDeviceState device_state;
if (p->primary_device != NULL)
- str = device_state_to_string(indicator_power_device_get_state(p->primary_device));
+ device_state = indicator_power_device_get_state(p->primary_device);
else
- str = "";
+ device_state = UP_DEVICE_STATE_UNKNOWN;
- return g_variant_new_string(str);
+ return g_variant_new_string(device_state_to_string(device_state));
}
static GVariant*