diff options
author | rbuj <[email protected]> | 2021-12-14 12:17:35 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2022-03-11 16:52:11 +0100 |
commit | b269d8c14d898f81574fb11af8bd8ea15208fc1d (patch) | |
tree | 821b0745fe6afb74bbe4a8b4b3a7230b9471796e /src/mate-screensaver-preferences.c | |
parent | 35fdef86b64ccd3307f3aeac05a496f8c8fc426f (diff) | |
download | mate-screensaver-b269d8c14d898f81574fb11af8bd8ea15208fc1d.tar.bz2 mate-screensaver-b269d8c14d898f81574fb11af8bd8ea15208fc1d.tar.xz |
mate-screensaver-preferences: Fix -Wfloat-conversion warnings
Diffstat (limited to 'src/mate-screensaver-preferences.c')
-rw-r--r-- | src/mate-screensaver-preferences.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/mate-screensaver-preferences.c b/src/mate-screensaver-preferences.c index 4722b31..105380c 100644 --- a/src/mate-screensaver-preferences.c +++ b/src/mate-screensaver-preferences.c @@ -93,10 +93,10 @@ static GSettings *session_settings = NULL; static GSettings *lockdown_settings = NULL; static MateDesktopThumbnailFactory *thumb_factory = NULL; -static gint32 +static gdouble config_get_activate_delay (gboolean *is_writable) { - gint32 delay; + gint delay; if (is_writable) { @@ -104,14 +104,12 @@ config_get_activate_delay (gboolean *is_writable) KEY_IDLE_DELAY); } - delay = g_settings_get_int (session_settings, KEY_IDLE_DELAY); - - if (delay < 1) + if ((delay = g_settings_get_int (session_settings, KEY_IDLE_DELAY)) < 1) { - delay = 1; + return 1.0; } - return delay; + return (gdouble) delay; } static void @@ -1072,7 +1070,7 @@ format_value_callback_time (GtkScale *scale, if (value == 0) return g_strdup_printf (_("Never")); - return time_to_string_text (value * 60.0); + return time_to_string_text ((long) (value * 60.0)); } static void @@ -1154,7 +1152,7 @@ ui_set_enabled (gboolean enabled) } static void -ui_set_delay (int delay) +ui_set_delay (gdouble delay) { GtkWidget *widget; @@ -1201,7 +1199,7 @@ key_changed_cb (GSettings *settings, const gchar *key, gpointer data) int delay; delay = g_settings_get_int (settings, key); - ui_set_delay (delay); + ui_set_delay ((gdouble) delay); } else |