diff options
author | Ted Gould <ted@gould.cx> | 2011-06-28 15:58:48 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-06-28 15:58:48 -0500 |
commit | 1ee7d8ddc51a65bb14f4a294abd7024fda5c11b3 (patch) | |
tree | 4ee77a964d57774954e2f151b6c623311be9c611 | |
parent | 8ee9f55f2a83f92860a6998eedcd879e4ac737c4 (diff) | |
download | ayatana-indicator-messages-1ee7d8ddc51a65bb14f4a294abd7024fda5c11b3.tar.gz ayatana-indicator-messages-1ee7d8ddc51a65bb14f4a294abd7024fda5c11b3.tar.bz2 ayatana-indicator-messages-1ee7d8ddc51a65bb14f4a294abd7024fda5c11b3.zip |
Adding in an idle function for handling the directory.
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/status-items.c | 20 |
2 files changed, 21 insertions, 1 deletions
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; +} |