diff -Naur bzr412/panel/applets/CMakeLists.txt bzr412.p/panel/applets/CMakeLists.txt --- bzr412/panel/applets/CMakeLists.txt 2011-03-07 19:30:02.000000000 +0100 +++ bzr412.p/panel/applets/CMakeLists.txt 2011-03-08 10:55:33.000000000 +0100 @@ -11,6 +11,14 @@ find_package(X11 REQUIRED) +execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} indicator --variable indicatordir OUTPUT_VARIABLE _indicatordir OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} indicator --variable iconsdir OUTPUT_VARIABLE _iconsdir OUTPUT_STRIP_TRAILING_WHITESPACE) + +add_definitions( + "-DINDICATORDIR=\"${_indicatordir}\"" + "-DINDICATORICONSDIR=\"${_iconsdir}\"" + ) + # Sources set(uqapplets_SRCS appindicator/appindicatorapplet.cpp diff -Naur bzr412/panel/applets/indicator/indicator.c bzr412.p/panel/applets/indicator/indicator.c --- bzr412/panel/applets/indicator/indicator.c 2011-03-07 19:30:02.000000000 +0100 +++ bzr412.p/panel/applets/indicator/indicator.c 2011-03-08 11:04:07.000000000 +0100 @@ -26,8 +26,6 @@ #define DEFAULT_SETTING1 NULL #define DEFAULT_SETTING2 1 #define DEFAULT_SETTING3 FALSE -#define ICONS_DIR "/usr/share/libindicator/icons/" -#define INDICATOR_DIR "/usr/lib/indicators/4/" typedef enum { PANEL_APPLET_ORIENT_LEFT, @@ -41,6 +39,7 @@ "libappmenu.so", "libapplication.so", "libsoundmenu.so", + "libnetworkmenu.so", "libmessaging.so", "libdatetime.so", "libme.so", @@ -339,7 +338,7 @@ g_debug("Loading Module: %s", name); /* Build the object for the module */ - gchar * fullpath = g_build_filename(INDICATOR_DIR, name, NULL); + gchar * fullpath = g_build_filename(INDICATORDIR, name, NULL); IndicatorObject * io = indicator_object_new_from_file(fullpath); g_free(fullpath); @@ -377,7 +376,6 @@ IndicatorPlugin *indicator; GtkOrientation orientation; gint indicators_loaded = 0; - const gchar *indicator_names[] = { "application", "messaging", "soundmenu", "datetime", "me", "session", 0 }; /* Hack! prevent the appmenu indicator from swallowing our own menubar */ setenv("APPMENU_DISPLAY_BOTH", "1"); @@ -391,7 +389,7 @@ g_object_set (gtk_settings_get_default(), "gtk-theme-name", "Ambiance", NULL); g_object_set (gtk_settings_get_default(), "gtk-icon-theme-name", "ubuntu-mono-dark", NULL); gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), - ICONS_DIR); + INDICATORICONSDIR); /* g_debug("Icons directory: %s", ICONS_DIR); */ gtk_rc_parse_string ( "widget \"indicator-applet*\" style \"panel\"\n" @@ -431,16 +429,24 @@ gtk_container_set_border_width(GTK_CONTAINER(indicator->menu), 0); /* load 'em */ - if (indicator_names) { - const gchar ** name = indicator_names; - for (; *name; ++name) { - gchar * libname = g_strdup_printf ("lib%s." G_MODULE_SUFFIX, *name); - if (load_module (libname, indicator->menu)) { - indicators_loaded++; - } - g_free (libname); - } - //g_strfreev (indicator_names); + if (!g_file_test (INDICATORDIR, + G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) + { + g_warning ("%s does not exist, cannot read any indicators", INDICATORDIR); + } else { + + GDir *dir; + const gchar *name; + + dir = g_dir_open (INDICATORDIR, 0, NULL); + while ((name = g_dir_read_name (dir)) != NULL) + { + if ((g_strcmp0(name, "libappmenu.so") != 0) && + load_module (name, indicator->menu)) + indicators_loaded++; + } + + g_dir_close (dir); } if (indicators_loaded == 0) {