summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-12-22 08:20:29 +0100
committerVictor Kareh <[email protected]>2022-03-22 16:13:14 -0400
commit95affff6b702f614dff0c313e707b92c19297177 (patch)
tree4376dc6c2b0121f10cb0dfaf346f2eec356e8f14
parentc97d51e16df73c4b99332d6ca9c7563c86989fc9 (diff)
downloadmate-screensaver-95affff6b702f614dff0c313e707b92c19297177.tar.bz2
mate-screensaver-95affff6b702f614dff0c313e707b92c19297177.tar.xz
gs-prefs: macros instead of static methods of one sentence
-rw-r--r--src/gs-prefs.c65
1 files changed, 9 insertions, 56 deletions
diff --git a/src/gs-prefs.c b/src/gs-prefs.c
index e9d42e2..0d2bea0 100644
--- a/src/gs-prefs.c
+++ b/src/gs-prefs.c
@@ -56,6 +56,15 @@ static void gs_prefs_finalize (GObject *object);
#define KEY_KEYBOARD_COMMAND "embedded-keyboard-command"
#define KEY_STATUS_MESSAGE_ENABLED "status-message-enabled"
+#define _gs_prefs_set_idle_activation_enabled(x,y) ((x)->idle_activation_enabled = ((y) != FALSE))
+#define _gs_prefs_set_lock_enabled(x,y) ((x)->lock_enabled = ((y) != FALSE))
+#define _gs_prefs_set_lock_disabled(x,y) ((x)->lock_disabled = ((y) != FALSE))
+#define _gs_prefs_set_user_switch_disabled(x,y) ((x)->user_switch_disabled = ((y) != FALSE))
+#define _gs_prefs_set_keyboard_enabled(x,y) ((x)->keyboard_enabled = ((y) != FALSE))
+#define _gs_prefs_set_status_message_enabled(x,y) ((x)->status_message_enabled = ((y) != FALSE))
+#define _gs_prefs_set_logout_enabled(x,y) ((x)->logout_enabled = ((y) != FALSE))
+#define _gs_prefs_set_user_switch_enabled(x,y) ((x)->user_switch_enabled = ((y) != FALSE))
+
struct GSPrefsPrivate
{
GSettings *settings;
@@ -212,41 +221,6 @@ _gs_prefs_set_themes (GSPrefs *prefs,
}
static void
-_gs_prefs_set_idle_activation_enabled (GSPrefs *prefs,
- gboolean value)
-{
- prefs->idle_activation_enabled = (value != FALSE);
-}
-
-static void
-_gs_prefs_set_lock_enabled (GSPrefs *prefs,
- gboolean value)
-{
- prefs->lock_enabled = (value != FALSE);
-}
-
-static void
-_gs_prefs_set_lock_disabled (GSPrefs *prefs,
- gboolean value)
-{
- prefs->lock_disabled = (value != FALSE);
-}
-
-static void
-_gs_prefs_set_user_switch_disabled (GSPrefs *prefs,
- gboolean value)
-{
- prefs->user_switch_disabled = (value != FALSE);
-}
-
-static void
-_gs_prefs_set_keyboard_enabled (GSPrefs *prefs,
- gboolean value)
-{
- prefs->keyboard_enabled = (value != FALSE);
-}
-
-static void
_gs_prefs_set_keyboard_command (GSPrefs *prefs,
const char *value)
{
@@ -262,20 +236,6 @@ _gs_prefs_set_keyboard_command (GSPrefs *prefs,
}
static void
-_gs_prefs_set_status_message_enabled (GSPrefs *prefs,
- gboolean enabled)
-{
- prefs->status_message_enabled = (enabled != FALSE);
-}
-
-static void
-_gs_prefs_set_logout_enabled (GSPrefs *prefs,
- gboolean value)
-{
- prefs->logout_enabled = (value != FALSE);
-}
-
-static void
_gs_prefs_set_logout_command (GSPrefs *prefs,
const char *value)
{
@@ -306,13 +266,6 @@ _gs_prefs_set_logout_timeout (GSPrefs *prefs,
}
static void
-_gs_prefs_set_user_switch_enabled (GSPrefs *prefs,
- gboolean value)
-{
- prefs->user_switch_enabled = (value != FALSE);
-}
-
-static void
gs_prefs_load_from_settings (GSPrefs *prefs)
{
glong value;