diff options
author | Stefano Karapetsas <[email protected]> | 2012-12-15 12:33:17 -0800 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2012-12-15 12:33:17 -0800 |
commit | 85c5ae14d75e3413b8f3f3aa38205ea852dcb20d (patch) | |
tree | 4750b8d23dfcb17aea6cbc62c7e1c788a6976a7b /plugins/media-keys | |
parent | 12dcf19aa5f51901053c273cd7f5c17ce85e909d (diff) | |
parent | c6a6cbde72489a0055ba63341a153fe365058072 (diff) | |
download | mate-settings-daemon-85c5ae14d75e3413b8f3f3aa38205ea852dcb20d.tar.bz2 mate-settings-daemon-85c5ae14d75e3413b8f3f3aa38205ea852dcb20d.tar.xz |
Merge pull request #31 from jasmineaura/develop
background revised, various other fixes & improvements
Diffstat (limited to 'plugins/media-keys')
-rw-r--r-- | plugins/media-keys/Makefile.am | 6 | ||||
-rw-r--r-- | plugins/media-keys/msd-media-keys-manager.c | 42 |
2 files changed, 20 insertions, 28 deletions
diff --git a/plugins/media-keys/Makefile.am b/plugins/media-keys/Makefile.am index 9bd9553..d0a7b6a 100644 --- a/plugins/media-keys/Makefile.am +++ b/plugins/media-keys/Makefile.am @@ -56,15 +56,15 @@ uninstall-local: rm -f $(DESTDIR)$(icondir)/scalable/$(context)/touchpad-disabled.svg msd-media-keys-manager-glue.h: msd-media-keys-manager.xml Makefile - dbus-binding-tool --prefix=msd_media_keys_manager --mode=glib-server $< > xgen-$(@F) \ + $(AM_V_GEN) dbus-binding-tool --prefix=msd_media_keys_manager --mode=glib-server $< > xgen-$(@F) \ && ( cmp -s xgen-$(@F) $@ || cp xgen-$(@F) $@ ) \ && rm -f xgen-$(@F) msd-marshal.c: msd-marshal.list - $(GLIB_GENMARSHAL) --prefix=msd_marshal $< --header --body --internal > $@ + $(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=msd_marshal $< --header --body --internal > $@ msd-marshal.h: msd-marshal.list - $(GLIB_GENMARSHAL) --prefix=msd_marshal $< --header --internal > $@ + $(AM_V_GEN) $(GLIB_GENMARSHAL) --prefix=msd_marshal $< --header --internal > $@ libmedia_keys_la_SOURCES = \ msd-media-keys-plugin.h \ 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; |