diff options
author | Ted Gould <ted@gould.cx> | 2010-02-10 08:32:29 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-10 08:32:29 -0600 |
commit | 07cba3340daeb169dc1e2ef28c01bafa7fb60448 (patch) | |
tree | 449de2c0731721eb79f523867554d5b04a44421f | |
parent | fb4952bf2d8884ba4ce84db885afb2dc37f653d9 (diff) | |
parent | 8be6fe7ae76d822cc8737f60b3c0ad930f371eb0 (diff) | |
download | libayatana-appindicator-07cba3340daeb169dc1e2ef28c01bafa7fb60448.tar.gz libayatana-appindicator-07cba3340daeb169dc1e2ef28c01bafa7fb60448.tar.bz2 libayatana-appindicator-07cba3340daeb169dc1e2ef28c01bafa7fb60448.zip |
Switching menu property to be an object path.
-rw-r--r-- | src/application-service-appstore.c | 11 | ||||
-rw-r--r-- | src/libappindicator/app-indicator.c | 20 |
2 files changed, 20 insertions, 11 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index c784495..ec6da50 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -222,7 +222,16 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err app_lru_file_touch(priv->lrufile, app->id, app->category); app->icon = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_NAME)); - app->menu = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_MENU)); + + GValue * menuval = (GValue *)g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_MENU); + if (G_VALUE_TYPE(menuval) == G_TYPE_STRING) { + /* This is here to support an older version where we + were using strings instea of object paths. */ + app->menu = g_value_dup_string(menuval); + } else { + app->menu = g_strdup((gchar *)g_value_get_boxed(menuval)); + } + if (g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_AICON_NAME) != NULL) { app->aicon = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_AICON_NAME)); } diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 426ee8c..540620c 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -215,10 +215,10 @@ app_indicator_class_init (AppIndicatorClass *klass) g_object_class_install_property(object_class, PROP_MENU, - g_param_spec_string (PROP_MENU_S, + g_param_spec_boxed (PROP_MENU_S, "The object path of the menu on DBus.", "A method for getting the menu path as a string for DBus.", - NULL, + DBUS_TYPE_G_OBJECT_PATH, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, @@ -547,14 +547,14 @@ app_indicator_get_property (GObject * object, guint prop_id, GValue * value, GPa break; case PROP_MENU: - if (G_VALUE_HOLDS_STRING(value)) { - if (priv->menuservice != NULL) { - g_object_get_property (G_OBJECT (priv->menuservice), DBUSMENU_SERVER_PROP_DBUS_OBJECT, value); - } - } else { - WARN_BAD_TYPE(PROP_MENU_S, value); - } - break; + if (priv->menuservice != NULL) { + GValue strval = {0}; + g_value_init(&strval, G_TYPE_STRING); + g_object_get_property (G_OBJECT (priv->menuservice), DBUSMENU_SERVER_PROP_DBUS_OBJECT, &strval); + g_value_set_boxed(value, g_value_get_string(&strval)); + g_value_unset(&strval); + } + break; case PROP_CONNECTED: g_value_set_boolean (value, priv->watcher_proxy != NULL ? TRUE : FALSE); |