diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-05-21 19:07:25 +0200 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-05-21 19:07:25 +0200 |
commit | 5faae9360d6836f4b5ab59ef2bbbf7cb624bafc1 (patch) | |
tree | f78c27c5edcc4f2df4f146e8e6bfce4698c9b5a8 /src | |
parent | 14716e2d8d8bf7ccd8ba3ee2e9607a718bf2ff66 (diff) | |
download | ayatana-indicator-messages-5faae9360d6836f4b5ab59ef2bbbf7cb624bafc1.tar.gz ayatana-indicator-messages-5faae9360d6836f4b5ab59ef2bbbf7cb624bafc1.tar.bz2 ayatana-indicator-messages-5faae9360d6836f4b5ab59ef2bbbf7cb624bafc1.zip |
Move build_launcher_core into build_launcher
Diffstat (limited to 'src')
-rw-r--r-- | src/messages-service.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/src/messages-service.c b/src/messages-service.c index 12b1ded..547e527 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -67,7 +67,6 @@ static void indicator_removed (IndicateListener * listener, IndicateListenerServ static void check_eclipses (AppMenuItem * ai); static void remove_eclipses (AppMenuItem * ai); static gboolean build_launcher (gpointer data); -static void build_launcher_core (const gchar * desktop); static gboolean build_launchers (gpointer data); static void check_hidden (void); @@ -170,7 +169,6 @@ typedef struct _launcherList_t launcherList_t; struct _launcherList_t { LauncherMenuItem * menuitem; DbusmenuMenuitem * separator; - GList * appdiritems; }; static gint @@ -928,21 +926,12 @@ static gboolean build_launcher (gpointer data) { gchar *desktop_id = data; + const gchar *desktop = data; GDesktopAppInfo *appinfo; appinfo = g_desktop_app_info_new (desktop_id); - build_launcher_core(g_desktop_app_info_get_filename (appinfo)); + desktop = g_desktop_app_info_get_filename (appinfo); - g_object_unref (appinfo); - g_free (desktop_id); - return FALSE; -} - -/* The core action of dealing with a desktop file that should - be a launcher */ -static void -build_launcher_core (const gchar * desktop) -{ /* Check to see if we already have a launcher */ GList * listitem; for (listitem = launcherList; listitem != NULL; listitem = listitem->next) { @@ -957,7 +946,6 @@ build_launcher_core (const gchar * desktop) /* Build the item */ launcherList_t * ll = g_new0(launcherList_t, 1); ll->menuitem = launcher_menu_item_new(desktop); - ll->appdiritems = g_list_append(NULL, g_strdup(desktop)); /* Build a separator */ ll->separator = dbusmenu_menuitem_new(); @@ -993,13 +981,11 @@ build_launcher_core (const gchar * desktop) resort_menu(root_menuitem); check_hidden(); - } else { - /* If so add ourselves */ - launcherList_t * ll = (launcherList_t *)listitem->data; - ll->appdiritems = g_list_append(ll->appdiritems, g_strdup(desktop)); } - return; + g_object_unref (appinfo); + g_free (desktop_id); + return FALSE; } /* This function goes through all the launchers that we're |