aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-06-28 18:29:18 -0500
committerTed Gould <ted@gould.cx>2011-06-28 18:29:18 -0500
commit48737cc43c2bbf9991a3d86889deaa482ab047c8 (patch)
tree2397e0b6e88054a5d460f8c33e4f392a324f59f5
parent15468aef1b10907846c3a104c09ef4fb7addf9fd (diff)
downloadayatana-indicator-messages-48737cc43c2bbf9991a3d86889deaa482ab047c8.tar.gz
ayatana-indicator-messages-48737cc43c2bbf9991a3d86889deaa482ab047c8.tar.bz2
ayatana-indicator-messages-48737cc43c2bbf9991a3d86889deaa482ab047c8.zip
Basic loadable modules
-rw-r--r--src/status-items.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/status-items.c b/src/status-items.c
index 885b2a7..69d229f 100644
--- a/src/status-items.c
+++ b/src/status-items.c
@@ -50,6 +50,7 @@ static gboolean load_status_provider (gpointer dir);
/* Globals */
static StatusProviderStatus current_status = STATUS_PROVIDER_STATUS_DISCONNECTED;
GList * menuitems = NULL;
+GList * status_providers = NULL;
/* Build the inital status items and start kicking off the async code
for handling all the statuses */
@@ -119,6 +120,25 @@ static gboolean
load_status_provider (gpointer dir)
{
gchar * provider = (gchar *)dir;
+
+ if (!g_file_test(provider, G_FILE_TEST_EXISTS)) {
+ goto exit_final;
+ }
+
+ g_debug("Loading status provider: %s", provider);
+
+ GModule * module;
+
+ module = g_module_open(provider, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
+ if (module == NULL) {
+ g_warning("Unable to module for: %s", provider);
+ goto exit_final;
+ }
+
+ /* Got it */
+ g_module_close(module);
+
+exit_final:
g_free(provider);
return FALSE;
}