diff options
-rw-r--r-- | src/launcher-menu-item.c | 36 |
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; |