diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2015-01-30 11:58:57 -0600 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2015-01-30 11:58:57 -0600 |
commit | 6057cd8dfac7ce74facf8ccf5da052097a70e274 (patch) | |
tree | 3cf3ec9ae5ce52618264005061c62967ec8a0f90 /src/service.c | |
parent | 32b591d59deddb6dc46fdd14d8fe5be4a5e6dd4f (diff) | |
download | ayatana-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/service.c')
-rw-r--r-- | src/service.c | 8 |
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* |