From 6057cd8dfac7ce74facf8ccf5da052097a70e274 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 30 Jan 2015 11:58:57 -0600 Subject: in the new device-state action state, use the string 'unknown' if no primary device is found. --- src/service.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') 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* -- cgit v1.2.3