diff options
author | Stefano Karapetsas <[email protected]> | 2012-10-12 17:56:17 +0200 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2012-10-12 17:56:17 +0200 |
commit | 8230a10b97810451abe1b3283f5adf627f33a8b1 (patch) | |
tree | a9b81ce8abdb741f9a2c9f0b24d9f89f059f7171 /libmate-panel-applet | |
parent | c049c82bbdda4c016f5ee28bce86918b60315dd2 (diff) | |
download | mate-panel-8230a10b97810451abe1b3283f5adf627f33a8b1.tar.bz2 mate-panel-8230a10b97810451abe1b3283f5adf627f33a8b1.tar.xz |
fix mate-panel-applet-gsettings.c
Diffstat (limited to 'libmate-panel-applet')
-rw-r--r-- | libmate-panel-applet/mate-panel-applet-gsettings.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/libmate-panel-applet/mate-panel-applet-gsettings.c b/libmate-panel-applet/mate-panel-applet-gsettings.c index 0acda0e8..6b8adb10 100644 --- a/libmate-panel-applet/mate-panel-applet-gsettings.c +++ b/libmate-panel-applet/mate-panel-applet-gsettings.c @@ -64,16 +64,14 @@ mate_panel_applet_settings_get_glist (GSettings *settings, gchar *key) void mate_panel_applet_settings_set_glist (GSettings *settings, gchar *key, GList *list) { - gchar **array; + GArray *array; GList *l; - gint i; + array = g_array_new (TRUE, TRUE, sizeof (gchar *)); for (l = list; l; l = l->next) { - array[i] = g_strdup (l->data); - i++; + array = g_array_append_val (array, l->data); } - array[i] = NULL; - g_settings_set_strv (settings, key, (const gchar **) array); - g_strfreev (array); + g_settings_set_strv (settings, key, (const gchar **) array->data); + g_array_free (array, TRUE); } GSList* @@ -95,14 +93,12 @@ mate_panel_applet_settings_get_gslist (GSettings *settings, gchar *key) void mate_panel_applet_settings_set_gslist (GSettings *settings, gchar *key, GSList *list) { - gchar **array; + GArray *array; GSList *l; - gint i; + array = g_array_new (TRUE, TRUE, sizeof (gchar *)); for (l = list; l; l = l->next) { - array[i] = g_strdup (l->data); - i++; + array = g_array_append_val (array, l->data); } - array[i] = NULL; - g_settings_set_strv (settings, key, (const gchar **) array); - g_strfreev (array); + g_settings_set_strv (settings, key, (const gchar **) array->data); + g_array_free (array, TRUE); } |