diff options
author | Ted Gould <ted@gould.cx> | 2010-02-17 15:41:38 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-17 15:41:38 -0600 |
commit | 3bd80ee8e9bfa1c2b50225b67349eaff8bbeafa2 (patch) | |
tree | a4498c0d85bb47c5c0229bfd477b0629b847bfe1 | |
parent | 7c08cb9a551c4c9c58bf7ebc1b591471479e9d73 (diff) | |
download | ayatana-indicator-messages-3bd80ee8e9bfa1c2b50225b67349eaff8bbeafa2.tar.gz ayatana-indicator-messages-3bd80ee8e9bfa1c2b50225b67349eaff8bbeafa2.tar.bz2 ayatana-indicator-messages-3bd80ee8e9bfa1c2b50225b67349eaff8bbeafa2.zip |
Adding a list to put the shortcuts in
-rw-r--r-- | src/app-menu-item.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/app-menu-item.c b/src/app-menu-item.c index 2f96c49..58c8a02 100644 --- a/src/app-menu-item.c +++ b/src/app-menu-item.c @@ -54,6 +54,7 @@ struct _AppMenuItemPrivate DbusmenuClient * client; DbusmenuMenuitemProxy * root; + GList * shortcuts; }; #define APP_MENU_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), APP_MENU_ITEM_TYPE, AppMenuItemPrivate)) @@ -123,10 +124,19 @@ app_menu_item_init (AppMenuItem *self) priv->client = NULL; priv->root = NULL; + priv->shortcuts = NULL; return; } +/* A wrapper to make the prototypes work for GFunc */ +static void +func_unref (gpointer data, gpointer user_data) +{ + g_object_unref(G_OBJECT(data)); + return; +} + /* Disconnect the count_changed signal and unref the listener */ static void app_menu_item_dispose (GObject *object) @@ -139,6 +149,13 @@ app_menu_item_dispose (GObject *object) g_object_unref(priv->listener); } + if (priv->shortcuts != NULL) { + g_list_foreach(priv->shortcuts, func_unref, NULL); + g_list_free(priv->shortcuts); + priv->shortcuts = NULL; + g_signal_emit(object, signals[SHORTCUTS_CHANGED], 0, TRUE); + } + if (priv->root != NULL) { g_object_unref(priv->root); priv->root = NULL; |