From 5129b9008a6700294bcd8d8f0fcaee4bef2932fc Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sat, 15 Dec 2012 05:40:43 +0200 Subject: [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 --- plugins/media-keys/msd-media-keys-manager.c | 42 ++++++++++++----------------- 1 file changed, 17 insertions(+), 25 deletions(-) (limited to 'plugins/media-keys') 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; -- cgit v1.2.1