aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-17 12:02:23 -0600
committerTed Gould <ted@gould.cx>2010-02-17 12:02:23 -0600
commitcccb9bc5f977a9d11ec3ee9b9055bbee3b2b6738 (patch)
tree3cef47402d9c0fb77d931e28d303c3d081a474c9
parent890a69be7f8df0137a55405afe915627599b3808 (diff)
downloadayatana-indicator-messages-cccb9bc5f977a9d11ec3ee9b9055bbee3b2b6738.tar.gz
ayatana-indicator-messages-cccb9bc5f977a9d11ec3ee9b9055bbee3b2b6738.tar.bz2
ayatana-indicator-messages-cccb9bc5f977a9d11ec3ee9b9055bbee3b2b6738.zip
Adding in shortcuts and ids private variables. Full lifecycle.
-rw-r--r--src/launcher-menu-item.c36
1 files changed, 30 insertions, 6 deletions
diff --git a/src/launcher-menu-item.c b/src/launcher-menu-item.c
index 089402d..238c4cf 100644
--- a/src/launcher-menu-item.c
+++ b/src/launcher-menu-item.c
@@ -27,6 +27,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <gdk/gdk.h>
#include <glib/gi18n.h>
#include <gio/gdesktopappinfo.h>
+#include <libindicator/indicator-desktop-shortcuts.h>
#include "launcher-menu-item.h"
#include "dbus-data.h"
@@ -42,6 +43,8 @@ struct _LauncherMenuItemPrivate
{
GAppInfo * appinfo;
gchar * desktop;
+ IndicatorDesktopShortcuts * ids;
+ GList * shortcuts;
};
#define LAUNCHER_MENU_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), LAUNCHER_MENU_ITEM_TYPE, LauncherMenuItemPrivate))
@@ -86,20 +89,21 @@ launcher_menu_item_init (LauncherMenuItem *self)
priv->appinfo = NULL;
priv->desktop = NULL;
+ priv->ids = NULL;
+ priv->shortcuts = NULL;
+
return;
}
static void
-launcher_menu_item_dispose (GObject *object)
+func_unref (gpointer data, gpointer user_data)
{
- // LauncherMenuItem * self = LAUNCHER_MENU_ITEM(object);
- // LauncherMenuItemPrivate * priv = LAUNCHER_MENU_ITEM_GET_PRIVATE(self);
-
- G_OBJECT_CLASS (launcher_menu_item_parent_class)->dispose (object);
+ g_object_unref(G_OBJECT(data));
+ return;
}
static void
-launcher_menu_item_finalize (GObject *object)
+launcher_menu_item_dispose (GObject *object)
{
LauncherMenuItem * self = LAUNCHER_MENU_ITEM(object);
LauncherMenuItemPrivate * priv = LAUNCHER_MENU_ITEM_GET_PRIVATE(self);
@@ -109,6 +113,26 @@ launcher_menu_item_finalize (GObject *object)
priv->appinfo = NULL;
}
+ if (priv->ids != NULL) {
+ g_object_unref(priv->ids);
+ priv->ids = NULL;
+ }
+
+ if (priv->shortcuts != NULL) {
+ g_list_foreach(priv->shortcuts, func_unref, NULL);
+ g_list_free(priv->shortcuts);
+ priv->shortcuts = NULL;
+ }
+
+ G_OBJECT_CLASS (launcher_menu_item_parent_class)->dispose (object);
+}
+
+static void
+launcher_menu_item_finalize (GObject *object)
+{
+ LauncherMenuItem * self = LAUNCHER_MENU_ITEM(object);
+ LauncherMenuItemPrivate * priv = LAUNCHER_MENU_ITEM_GET_PRIVATE(self);
+
if (priv->desktop != NULL) {
g_free(priv->desktop);
priv->desktop = NULL;