From 2253177c635527479c2d6b096dcb870b9600f3da Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 3 Dec 2008 23:51:29 -0800 Subject: Parse directories --- src/Makefile.am | 2 +- src/applet-main.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 1ebaa38..f0f9c6e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,7 +5,7 @@ libexec_PROGRAMS = \ indicator_applet_CFLAGS = \ -DG_LOG_DOMAIN=\""Indicator-Applet"\" \ -DDATADIR=\""$(datadir)"\" \ - -DINDICATOR_DIR=\""$(libexecdir)/indicator-applet/indicators/"\" \ + -DINDICATOR_DIR=\""$(libexecdir)/indicators/1"\" \ $(APPLET_CFLAGS) indicator_applet_SOURCES = \ diff --git a/src/applet-main.c b/src/applet-main.c index b439bc8..f21112c 100644 --- a/src/applet-main.c +++ b/src/applet-main.c @@ -19,6 +19,12 @@ PANEL_APPLET_BONOBO_FACTORY ("OAFIID:GNOME_IndicatorApplet_Factory", /************* * init function * ***********/ +static gboolean +load_module (const gchar * name) +{ + + return FALSE; +} static gboolean applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data) @@ -35,6 +41,15 @@ applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data) int indicators_loaded = 0; /* load 'em */ + if (g_file_test(INDICATOR_DIR, (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))) { + GDir * dir = g_dir_open(INDICATOR_DIR, 0, NULL); + + const gchar * name; + while ((name = g_dir_read_name(dir)) != NULL) { + if (load_module(name)) + indicators_loaded++; + } + } if (indicators_loaded == 0) { GtkWidget * item = gtk_menu_item_new_with_label("No Indicators"); -- cgit v1.2.3