aboutsummaryrefslogtreecommitdiff
path: root/src/messages-service.c
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-08-19 16:55:57 -0500
committerTed Gould <ted@canonical.com>2009-08-19 16:55:57 -0500
commit23e2cdf7f788996e5dc429444b1fd81425bf3b05 (patch)
treee4f1b01c08c47c40c4678e807ada7b38b57a4788 /src/messages-service.c
parent24cd5919a5de12b2309ba6f9fa48f402e3d2ae11 (diff)
downloadayatana-indicator-messages-23e2cdf7f788996e5dc429444b1fd81425bf3b05.tar.gz
ayatana-indicator-messages-23e2cdf7f788996e5dc429444b1fd81425bf3b05.tar.bz2
ayatana-indicator-messages-23e2cdf7f788996e5dc429444b1fd81425bf3b05.zip
Spliting out the building of the items as it'll read the desktop file off disk and parse it.
Diffstat (limited to 'src/messages-service.c')
-rw-r--r--src/messages-service.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/messages-service.c b/src/messages-service.c
index ce3fcdb..481df1d 100644
--- a/src/messages-service.c
+++ b/src/messages-service.c
@@ -489,6 +489,20 @@ indicator_removed (IndicateListener * listener, IndicateListenerServer * server,
}
gboolean
+build_launcher (gpointer data)
+{
+ gchar * path = (gchar *)data;
+
+ launcherList_t * ll = g_new0(launcherList_t, 1);
+ ll->menuitem = launcher_menu_item_new(path);
+
+ g_free(path);
+
+ launcherList = g_list_insert_sorted(launcherList, ll, launcherList_sort);
+ return FALSE;
+}
+
+gboolean
build_launchers (gpointer data)
{
if (!g_file_test(SYSTEM_APPS_DIR, G_FILE_TEST_IS_DIR)) {
@@ -506,10 +520,7 @@ build_launchers (gpointer data)
const gchar * filename = NULL;
while ((filename = g_dir_read_name(dir)) != NULL) {
gchar * path = g_build_filename(SYSTEM_APPS_DIR, filename, NULL);
- launcherList_t * ll = g_new0(launcherList_t, 1);
- ll->menuitem = launcher_menu_item_new(path);
- g_free(path);
- launcherList = g_list_append(launcherList, ll);
+ g_idle_add(build_launcher, path);
}
g_dir_close(dir);