From 962c75b3cf9d301227d7f584fa913ef21f28bd78 Mon Sep 17 00:00:00 2001 From: gm10 <13855078+gm10@users.noreply.github.com> Date: Sat, 27 Jul 2019 11:23:47 +0200 Subject: Change media-keys volume-step default from 6 to 5 in the gschema and use only that instead of a redundant constant in the code. --- data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in | 2 +- plugins/media-keys/msd-media-keys-manager.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in b/data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in index 9677b6a..866fbf7 100644 --- a/data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in +++ b/data/org.mate.SettingsDaemon.plugins.media-keys.gschema.xml.in @@ -16,7 +16,7 @@ Priority to use for this plugin in mate-settings-daemon startup queue - 6 + 5 Volume step Volume step as percentage of volume. diff --git a/plugins/media-keys/msd-media-keys-manager.c b/plugins/media-keys/msd-media-keys-manager.c index a68835f..b1fe2dc 100644 --- a/plugins/media-keys/msd-media-keys-manager.c +++ b/plugins/media-keys/msd-media-keys-manager.c @@ -58,8 +58,6 @@ #define TOUCHPAD_SCHEMA "org.mate.peripherals-touchpad" #define TOUCHPAD_ENABLED_KEY "touchpad-enabled" -#define VOLUME_STEP 6 - #define MSD_MEDIA_KEYS_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), MSD_TYPE_MEDIA_KEYS_MANAGER, MsdMediaKeysManagerPrivate)) typedef struct { @@ -732,9 +730,11 @@ do_sound_action (MsdMediaKeysManager *manager, volume_max = mate_mixer_stream_control_get_normal_volume (control); volume_step = g_settings_get_int (manager->priv->settings, "volume-step"); - if (volume_step <= 0 || - volume_step > 100) - volume_step = VOLUME_STEP; + if (volume_step <= 0 || volume_step > 100) { + GVariant *variant = g_settings_get_default_value (manager->priv->settings, "volume-step"); + volume_step = g_variant_get_int32 (variant); + g_variant_unref (variant); + } /* Scale the volume step size accordingly to the range used by the control */ volume_step = (volume_max - volume_min) * volume_step / 100; -- cgit v1.2.1