diff options
author | Ted Gould <ted@gould.cx> | 2010-06-18 11:16:33 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-06-18 11:16:33 -0500 |
commit | 87d82b8a092ec250ba08c14e95e3309ae2cc4f39 (patch) | |
tree | a72b040944830074d3a9ec36b5b9ce255cf43515 /src/application-service-appstore.c | |
parent | 250a731fb356b1fcf46b14a1c39882875a208a69 (diff) | |
parent | d4f5fa77e921df815bd67080167a461c51791a26 (diff) | |
download | libayatana-appindicator-87d82b8a092ec250ba08c14e95e3309ae2cc4f39.tar.gz libayatana-appindicator-87d82b8a092ec250ba08c14e95e3309ae2cc4f39.tar.bz2 libayatana-appindicator-87d82b8a092ec250ba08c14e95e3309ae2cc4f39.zip |
Make icon switching work again.
Diffstat (limited to 'src/application-service-appstore.c')
-rw-r--r-- | src/application-service-appstore.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 66943b5..15abea3 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -243,7 +243,21 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err static AppIndicatorStatus string_to_status(const gchar * status_string) { - return (AppIndicatorStatus) g_enum_get_value_by_nick((GEnumClass *)g_type_class_ref (APP_INDICATOR_TYPE_INDICATOR_STATUS), status_string); + GEnumClass * klass = G_ENUM_CLASS(g_type_class_ref(APP_INDICATOR_TYPE_INDICATOR_STATUS)); + g_return_val_if_fail(klass != NULL, APP_INDICATOR_STATUS_PASSIVE); + + AppIndicatorStatus retval = APP_INDICATOR_STATUS_PASSIVE; + + GEnumValue * val = g_enum_get_value_by_nick(klass, status_string); + if (val == NULL) { + g_warning("Unrecognized status '%s' assuming passive.", status_string); + } else { + retval = (AppIndicatorStatus)val->value; + } + + g_type_class_unref(klass); + + return retval; } /* A small helper function to get the position of an application |