aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2008-12-03 23:51:29 -0800
committerTed Gould <ted@canonical.com>2008-12-03 23:51:29 -0800
commit2253177c635527479c2d6b096dcb870b9600f3da (patch)
treeabcfed4be17a6615d6043553f110d036047825b6 /src
parent75f4a72eaca3053d765c903bb0a6844cec10209c (diff)
downloadlibayatana-indicator-2253177c635527479c2d6b096dcb870b9600f3da.tar.gz
libayatana-indicator-2253177c635527479c2d6b096dcb870b9600f3da.tar.bz2
libayatana-indicator-2253177c635527479c2d6b096dcb870b9600f3da.zip
Parse directories
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/applet-main.c15
2 files changed, 16 insertions, 1 deletions
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");