summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/housekeeping/msd-ldsm-dialog.c29
-rw-r--r--plugins/media-keys/msd-media-keys-manager.c42
-rw-r--r--plugins/xrandr/msd-xrandr-manager.c3
3 files changed, 34 insertions, 40 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");
}
diff --git a/plugins/media-keys/msd-media-keys-manager.c b/plugins/media-keys/msd-media-keys-manager.c
index 0741f12..5583416 100644
--- a/plugins/media-keys/msd-media-keys-manager.c
+++ b/plugins/media-keys/msd-media-keys-manager.c
@@ -157,28 +157,23 @@ acme_error (char * msg)
static char *
get_term_command (MsdMediaKeysManager *manager)
{
- char *cmd_term;
- char *cmd = NULL;
-
- GSettings *settings_terminal;
- settings_terminal = g_settings_new ("org.mate.applications-terminal");
-
- cmd_term = g_settings_get_string (settings_terminal, "exec");
- if ((cmd_term != NULL) && (strcmp (cmd_term, "") != 0)) {
- char *cmd_args;
- cmd_args = g_settings_get_string (settings_terminal, "exec_arg");
- if ((cmd_args != NULL) && (strcmp (cmd_term, "") != 0)) {
- cmd = g_strdup_printf ("%s %s -e", cmd_term, cmd_args);
- } else {
- cmd = g_strdup_printf ("%s -e", cmd_term);
- }
-
- g_free (cmd_args);
- }
-
- g_free (cmd_term);
+ char *cmd_term, *cmd_args;
+ char *cmd = NULL;
+ GSettings *settings;
+
+ settings = g_settings_new ("org.mate.applications-terminal");
+ cmd_term = g_settings_get_string (settings, "exec");
+ cmd_args = g_settings_get_string (settings, "exec_arg");
+
+ if (cmd_term[0] != '\0') {
+ cmd = g_strdup_printf ("%s %s -e", cmd_term, cmd_args);
+ } else {
+ cmd = g_strdup_printf ("mate-terminal -e");
+ }
- g_object_unref (settings_terminal);
+ g_free (cmd_args);
+ g_free (cmd_term);
+ g_object_unref (settings);
return cmd;
}
@@ -662,10 +657,7 @@ do_sound_action (MsdMediaKeysManager *manager,
return;
#endif
- vol_step = g_settings_get_int (manager->priv->settings, "volume-step");
-
- if (vol_step <= 0 || vol_step > 100)
- vol_step = VOLUME_STEP;
+ vol_step = VOLUME_STEP;
#ifdef HAVE_PULSE
norm_vol_step = PA_VOLUME_NORM * vol_step / 100;
diff --git a/plugins/xrandr/msd-xrandr-manager.c b/plugins/xrandr/msd-xrandr-manager.c
index 7c6a046..c56cd51 100644
--- a/plugins/xrandr/msd-xrandr-manager.c
+++ b/plugins/xrandr/msd-xrandr-manager.c
@@ -2156,7 +2156,8 @@ on_config_changed (GSettings *settings,
gchar *key,
MsdXrandrManager *manager)
{
- start_or_stop_icon (manager);
+ if (g_strcmp0 (key, CONF_KEY_SHOW_NOTIFICATION_ICON) == 0)
+ start_or_stop_icon (manager);
}
static gboolean