summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-06-08 14:17:45 +0300
committermonsta <[email protected]>2016-06-08 14:17:45 +0300
commit1522904e12470f9e632c32c2b44555e41e11d15a (patch)
treeb6cc774a1e1775c4a37c444b2e3ef31ad7fbffe8
parent4385b4835dc16d392fe6ca8d84ab6aba4a725dfe (diff)
downloadmate-indicator-applet-1522904e12470f9e632c32c2b44555e41e11d15a.tar.bz2
mate-indicator-applet-1522904e12470f9e632c32c2b44555e41e11d15a.tar.xz
move indicator loading/setup code into separate function
-rw-r--r--src/applet-main.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/src/applet-main.c b/src/applet-main.c
index 36a165d..385c21a 100644
--- a/src/applet-main.c
+++ b/src/applet-main.c
@@ -505,24 +505,9 @@ update_accessible_desc(IndicatorObjectEntry * entry, GtkWidget * menuitem)
return;
}
-
-static gboolean
-load_module (const gchar * name, GtkWidget * menubar)
+static void
+load_indicator (GtkWidget * menubar, IndicatorObject *io, const gchar *name)
{
- g_debug("Looking at Module: %s", name);
- g_return_val_if_fail(name != NULL, FALSE);
-
- if (!g_str_has_suffix(name, G_MODULE_SUFFIX)) {
- return FALSE;
- }
-
- g_debug("Loading Module: %s", name);
-
- /* Build the object for the module */
- gchar * fullpath = g_build_filename(INDICATOR_DIR, name, NULL);
- IndicatorObject * io = indicator_object_new_from_file(fullpath);
- g_free(fullpath);
-
/* Set the environment it's in */
indicator_object_set_environment(io, (const GStrv)indicator_env);
@@ -546,6 +531,26 @@ load_module (const gchar * name, GtkWidget * menubar)
}
g_list_free(entries);
+}
+
+static gboolean
+load_module (const gchar * name, GtkWidget * menubar)
+{
+ g_debug("Looking at Module: %s", name);
+ g_return_val_if_fail(name != NULL, FALSE);
+
+ if (!g_str_has_suffix(name, G_MODULE_SUFFIX)) {
+ return FALSE;
+ }
+
+ g_debug("Loading Module: %s", name);
+
+ /* Build the object for the module */
+ gchar * fullpath = g_build_filename(INDICATOR_DIR, name, NULL);
+ IndicatorObject * io = indicator_object_new_from_file(fullpath);
+ g_free(fullpath);
+
+ load_indicator(menubar, io, name);
return TRUE;
}