diff options
author | Jasmine Hassan <[email protected]> | 2012-12-15 05:40:43 +0200 |
---|---|---|
committer | Jasmine Hassan <[email protected]> | 2012-12-15 07:04:12 +0200 |
commit | 5129b9008a6700294bcd8d8f0fcaee4bef2932fc (patch) | |
tree | 3a9abc5efd78c9edd0b5cb1328c82f03febe82fb /plugins/housekeeping | |
parent | 4d955a71bb6117c72da4291ccd2a9f617e9ed7fd (diff) | |
download | mate-settings-daemon-5129b9008a6700294bcd8d8f0fcaee4bef2932fc.tar.bz2 mate-settings-daemon-5129b9008a6700294bcd8d8f0fcaee4bef2932fc.tar.xz |
[plugins] various small fixes/improvements
In plugins/housekeeping/gsd-ldsm-dialog.c
- Initialize GSList ignore_paths before use
- Use g_slist_prepend instead of _append in loop (more efficient), reverse after
In plugins/media-keys/msd-media-keys-manager.c
- Default to mate-terminal if terminal "exec" key is empty
In plugins/xrandr/msd-xrandr-manager.c
- Only start_or_stop_icon when the show icon key actually changes
Also, adapt this for media-keys plugin:
Don't use org.gnome.settings-daemon for volume_step setting
http://git.gnome.org/browse/gnome-settings-daemon/commit/?id=1a9eea8224d41643a8a7a05d799198058e36e1a8
Diffstat (limited to 'plugins/housekeeping')
-rw-r--r-- | plugins/housekeeping/msd-ldsm-dialog.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/plugins/housekeeping/msd-ldsm-dialog.c b/plugins/housekeeping/msd-ldsm-dialog.c index d961d8a..ea95540 100644 --- a/plugins/housekeeping/msd-ldsm-dialog.c +++ b/plugins/housekeeping/msd-ldsm-dialog.c @@ -151,25 +151,25 @@ ignore_check_button_toggled_cb (GtkToggleButton *button, { MsdLdsmDialog *dialog = (MsdLdsmDialog *)user_data; GSettings *settings; - GSList *ignore_paths; + gchar **settings_list; + GSList *ignore_paths = NULL; GError *error = NULL; gboolean ignore, ret, updated; - gchar **settings_list; - + gint i; + settings = g_settings_new (SETTINGS_SCHEMA); - + settings_list = g_settings_get_strv (settings, SETTINGS_IGNORE_PATHS); - if (settings_list != NULL) { - gint i; - for (i = 0; i < G_N_ELEMENTS (settings_list); i++) { - if (settings_list[i] != NULL) - ignore_paths = g_slist_append (ignore_paths, g_strdup (settings_list[i])); - } - g_strfreev (settings_list); + for (i = 0; i < G_N_ELEMENTS (settings_list); i++) { + if (settings_list[i] != NULL) + ignore_paths = g_slist_prepend (ignore_paths, g_strdup (settings_list[i])); } - - + g_strfreev (settings_list); + + if (i > 0) + ignore_paths = g_slist_reverse (ignore_paths); + ignore = gtk_toggle_button_get_active (button); updated = update_ignore_paths (&ignore_paths, dialog->priv->mount_path, ignore); @@ -179,9 +179,10 @@ ignore_check_button_toggled_cb (GtkToggleButton *button, for (l = ignore_paths; l != NULL; l = l->next) g_ptr_array_add (array, l->data); + g_ptr_array_add (array, NULL); - if (!g_settings_set_strv (settings, "ignore-paths", (const gchar **) array->pdata)) { + if (!g_settings_set_strv (settings, SETTINGS_IGNORE_PATHS, (const gchar **) array->pdata)) { g_warning ("Cannot change ignore preference - failed to commit changes"); } |