summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColomban Wendling <[email protected]>2015-01-20 18:45:34 +0100
committerinfirit <[email protected]>2015-01-20 18:45:34 +0100
commit47049eaad4650307650b904b3c44a8f1650bc49e (patch)
treefe9161789908b9fc469413f1c856989ec113c9a6
parentfe9ef7eca1b83272408bc2d137cffa55512bea3e (diff)
downloadmate-session-manager-47049eaad4650307650b904b3c44a8f1650bc49e.tar.bz2
mate-session-manager-47049eaad4650307650b904b3c44a8f1650bc49e.tar.xz
MsmGnome: Fix and simplify logic
-rw-r--r--mate-session/msm-gnome.c38
1 files changed, 15 insertions, 23 deletions
diff --git a/mate-session/msm-gnome.c b/mate-session/msm-gnome.c
index 519d6a7..e7dd68f 100644
--- a/mate-session/msm-gnome.c
+++ b/mate-session/msm-gnome.c
@@ -228,8 +228,6 @@ msm_gnome_start (void)
{
GSettings* settings;
gchar **array;
- GList *startup = NULL;
- gint i;
if (gnome_compat_started == TRUE)
return;
@@ -237,32 +235,26 @@ msm_gnome_start (void)
settings = g_settings_new (GSM_SCHEMA);
array = g_settings_get_strv (settings, GSM_GNOME_COMPAT_STARTUP_KEY);
if (array) {
- for (i = 0; array[i]; i++) {
- startup = g_list_append (startup, g_strdup (array[i]));
- }
- }
- g_strfreev (array);
- g_object_unref (settings);
+ guint i;
- if (startup != NULL) {
- if (g_list_find_custom (startup, "smproxy", (GCompareFunc) strcmp) != NULL) {
- g_debug ("MsmGnome: starting smproxy");
- msm_compat_gnome_smproxy_startup ();
- gnome_compat_started = TRUE;
- } else if (g_list_find_custom (startup, "keyring", (GCompareFunc) strcmp) != NULL) {
- g_debug ("MsmGnome: starting keyring");
- gnome_keyring_daemon_startup ();
- gnome_compat_started = TRUE;
- } else {
- g_debug ("MsmGnome: unknown component, ignoring");
+ for (i = 0; array[i]; i++) {
+ if (strcmp (array[i], "smproxy") == 0) {
+ g_debug ("MsmGnome: starting smproxy");
+ msm_compat_gnome_smproxy_startup ();
+ gnome_compat_started = TRUE;
+ } else if (strcmp (array[i], "keyring") == 0) {
+ g_debug ("MsmGnome: starting keyring");
+ gnome_keyring_daemon_startup ();
+ gnome_compat_started = TRUE;
+ } else {
+ g_debug ("MsmGnome: ignoring unknown component \"%s\"", array[i]);
+ }
}
-
- g_list_foreach (startup, (GFunc) g_free, NULL);
- g_list_free (startup);
-
+ g_strfreev (array);
} else {
g_debug ("MsmGnome: No components found to start");
}
+ g_object_unref (settings);
}