aboutsummaryrefslogtreecommitdiff
path: root/src/session-service.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-03-10 14:54:59 -0600
committerTed Gould <ted@gould.cx>2011-03-10 14:54:59 -0600
commit2426a2119ad12042da1c0c77cf578b9ae0f3ff43 (patch)
tree203c142d5df2f2ad3c41a0aa902ed79db89d51e1 /src/session-service.c
parent5f49c2d82c4f69d18531e73e6a7aae531a3f40d0 (diff)
downloadayatana-indicator-session-2426a2119ad12042da1c0c77cf578b9ae0f3ff43.tar.gz
ayatana-indicator-session-2426a2119ad12042da1c0c77cf578b9ae0f3ff43.tar.bz2
ayatana-indicator-session-2426a2119ad12042da1c0c77cf578b9ae0f3ff43.zip
Putting the appinfo's into a list so that we can sort them
Diffstat (limited to 'src/session-service.c')
-rw-r--r--src/session-service.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/session-service.c b/src/session-service.c
index 043bf20..c25939a 100644
--- a/src/session-service.c
+++ b/src/session-service.c
@@ -731,6 +731,8 @@ rebuild_items (DbusmenuMenuitem *root,
/* now add extra launchers */
extra_launchers_dir = g_dir_open (EXTRA_LAUNCHER_DIR, 0, NULL);
if (extra_launchers_dir != NULL) {
+ GList * launchers = NULL;
+
for (;;) {
extra_launcher_file = g_dir_read_name (extra_launchers_dir);
if (extra_launcher_file == NULL)
@@ -742,12 +744,21 @@ rebuild_items (DbusmenuMenuitem *root,
GAppInfo * appinfo = G_APP_INFO(g_desktop_app_info_new_from_filename (full_path));
g_free (full_path);
+ launchers = g_list_prepend(launchers, appinfo);
+ }
+
+ GList * launcher = NULL;
+ for (launcher = launchers; launcher != NULL; launcher = g_list_next(launcher)) {
+ GAppInfo * appinfo = G_APP_INFO(launcher->data);
+
add_extra_separator_once (root);
DbusmenuMenuitem * desktop_mi = dbusmenu_menuitem_new();
dbusmenu_menuitem_property_set(desktop_mi, DBUSMENU_MENUITEM_PROP_LABEL, g_app_info_get_name(appinfo));
g_signal_connect(G_OBJECT(desktop_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(desktop_activate_cb), appinfo);
dbusmenu_menuitem_child_append(root, desktop_mi);
}
+
+ g_list_free(launchers);
}
return;