From 1ee7d8ddc51a65bb14f4a294abd7024fda5c11b3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 28 Jun 2011 15:58:48 -0500 Subject: Adding in an idle function for handling the directory. --- src/Makefile.am | 2 +- src/status-items.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 4f654da..de4fccb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -67,7 +67,7 @@ indicator_messages_service_CFLAGS = \ -Wl,--as-needed \ -Werror \ -DG_LOG_DOMAIN=\"Indicator-Messages\" \ - -DSTAUTS_PROVIDER_DIR=\"$(STATUS_PROVIDER_DIR)\" + -DSTATUS_PROVIDER_DIR=\"$(STATUS_PROVIDER_DIR)\" indicator_messages_service_LDADD = $(APPLET_LIBS) diff --git a/src/status-items.c b/src/status-items.c index c0f60cd..e5e0d71 100644 --- a/src/status-items.c +++ b/src/status-items.c @@ -42,6 +42,10 @@ static const gchar * panel_active_icons[STATUS_PROVIDER_STATUS_LAST] = { /* STATUS_PROVIDER_STATUS_DISCONNECTED */ "indicator-messages-new-user-disconnected" }; +/* Prototypes */ +static gboolean provider_directory_parse (gpointer dir); + +/* Globals */ static StatusProviderStatus current_status = STATUS_PROVIDER_STATUS_DISCONNECTED; GList * menuitems = NULL; @@ -66,6 +70,8 @@ status_items_build (void) menuitems = g_list_append(menuitems, item); } + g_idle_add(provider_directory_parse, STATUS_PROVIDER_DIR); + return menuitems; } @@ -79,3 +85,17 @@ status_current_panel_icon (gboolean alert) return panel_icons[current_status]; } } + +/* Start parsing a directory and setting up the entires in the idle loop */ +static gboolean +provider_directory_parse (gpointer directory) +{ + const gchar * dir = (const gchar *)directory; + + if (!g_file_test(dir, G_FILE_TEST_EXISTS)) { + return FALSE; + } + + + return FALSE; +} -- cgit v1.2.3