diff options
Diffstat (limited to 'src/gs-prefs.c')
-rw-r--r-- | src/gs-prefs.c | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/src/gs-prefs.c b/src/gs-prefs.c index 1a8a426..6d7f562 100644 --- a/src/gs-prefs.c +++ b/src/gs-prefs.c @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * * Authors: William Jon McCann <[email protected]> * @@ -60,7 +60,7 @@ static void gs_prefs_finalize (GObject *object); struct GSPrefsPrivate { GSettings *settings; - GSettings *lockdown; + GSettings *lockdown_settings; }; enum @@ -203,7 +203,7 @@ static void _gs_prefs_set_themes (GSPrefs *prefs, gchar **values) { - guint i; + guint i; if (prefs->themes) { g_slist_foreach (prefs->themes, (GFunc)g_free, NULL); @@ -213,7 +213,7 @@ _gs_prefs_set_themes (GSPrefs *prefs, /* take ownership of the list */ prefs->themes = NULL; for (i=0; values[i] != NULL; i++) - prefs->themes = g_slist_append (prefs->themes, g_strdup (values[i])); + prefs->themes = g_slist_append (prefs->themes, g_strdup (values[i])); } static void @@ -320,84 +320,84 @@ _gs_prefs_set_user_switch_enabled (GSPrefs *prefs, static void gs_prefs_load_from_settings (GSPrefs *prefs) { - glong value; - gboolean bvalue; - char *string; + glong value; + gboolean bvalue; + char *string; gchar **strv; gint mode; bvalue = g_settings_get_boolean (prefs->priv->settings, KEY_IDLE_ACTIVATION_ENABLED); - _gs_prefs_set_idle_activation_enabled (prefs, bvalue); + _gs_prefs_set_idle_activation_enabled (prefs, bvalue); bvalue = g_settings_get_boolean (prefs->priv->settings, KEY_LOCK_ENABLED); - _gs_prefs_set_lock_enabled (prefs, bvalue); + _gs_prefs_set_lock_enabled (prefs, bvalue); - bvalue = g_settings_get_boolean (prefs->priv->lockdown, KEY_LOCK_DISABLE); - _gs_prefs_set_lock_disabled (prefs, bvalue); + bvalue = g_settings_get_boolean (prefs->priv->lockdown_settings, KEY_LOCK_DISABLE); + _gs_prefs_set_lock_disabled (prefs, bvalue); - bvalue = g_settings_get_boolean (prefs->priv->lockdown, KEY_USER_SWITCH_DISABLE); - _gs_prefs_set_user_switch_disabled (prefs, bvalue); + bvalue = g_settings_get_boolean (prefs->priv->lockdown_settings, KEY_USER_SWITCH_DISABLE); + _gs_prefs_set_user_switch_disabled (prefs, bvalue); value = g_settings_get_int (prefs->priv->settings, KEY_ACTIVATE_DELAY); - _gs_prefs_set_timeout (prefs, value); + _gs_prefs_set_timeout (prefs, value); value = g_settings_get_int (prefs->priv->settings, KEY_POWER_DELAY); - _gs_prefs_set_power_timeout (prefs, value); + _gs_prefs_set_power_timeout (prefs, value); value = g_settings_get_int (prefs->priv->settings, KEY_LOCK_DELAY); - _gs_prefs_set_lock_timeout (prefs, value); + _gs_prefs_set_lock_timeout (prefs, value); value = g_settings_get_int (prefs->priv->settings, KEY_CYCLE_DELAY); - _gs_prefs_set_cycle_timeout (prefs, value); + _gs_prefs_set_cycle_timeout (prefs, value); mode = g_settings_get_enum (prefs->priv->settings, KEY_MODE); - _gs_prefs_set_mode (prefs, mode); + _gs_prefs_set_mode (prefs, mode); strv = g_settings_get_strv (prefs->priv->settings, KEY_THEMES); - _gs_prefs_set_themes (prefs, strv); - g_strfreev (strv); + _gs_prefs_set_themes (prefs, strv); + g_strfreev (strv); /* Embedded keyboard options */ bvalue = g_settings_get_boolean (prefs->priv->settings, KEY_KEYBOARD_ENABLED); - _gs_prefs_set_keyboard_enabled (prefs, bvalue); + _gs_prefs_set_keyboard_enabled (prefs, bvalue); string = g_settings_get_string (prefs->priv->settings, KEY_KEYBOARD_COMMAND); - _gs_prefs_set_keyboard_command (prefs, string); + _gs_prefs_set_keyboard_command (prefs, string); g_free (string); bvalue = g_settings_get_boolean (prefs->priv->settings, KEY_STATUS_MESSAGE_ENABLED); - _gs_prefs_set_status_message_enabled (prefs, bvalue); + _gs_prefs_set_status_message_enabled (prefs, bvalue); /* Logout options */ bvalue = g_settings_get_boolean (prefs->priv->settings, KEY_LOGOUT_ENABLED); - _gs_prefs_set_logout_enabled (prefs, bvalue); + _gs_prefs_set_logout_enabled (prefs, bvalue); string = g_settings_get_string (prefs->priv->settings, KEY_LOGOUT_COMMAND); - _gs_prefs_set_logout_command (prefs, string); + _gs_prefs_set_logout_command (prefs, string); g_free (string); value = g_settings_get_int (prefs->priv->settings, KEY_LOGOUT_DELAY); - _gs_prefs_set_logout_timeout (prefs, value); + _gs_prefs_set_logout_timeout (prefs, value); /* User switching options */ bvalue = g_settings_get_boolean (prefs->priv->settings, KEY_USER_SWITCH_ENABLED); - _gs_prefs_set_user_switch_enabled (prefs, bvalue); + _gs_prefs_set_user_switch_enabled (prefs, bvalue); } static void key_changed_cb (GSettings *settings, - const gchar *key, - GSPrefs *prefs) + gchar *key, + GSPrefs *prefs) { if (strcmp (key, KEY_MODE) == 0) { gint mode; mode = g_settings_get_enum (settings, key); - _gs_prefs_set_mode (prefs, mode); + _gs_prefs_set_mode (prefs, mode); } else if (strcmp (key, KEY_THEMES) == 0) @@ -405,8 +405,8 @@ key_changed_cb (GSettings *settings, gchar **strv = NULL; strv = g_settings_get_strv (settings, key); - _gs_prefs_set_themes (prefs, strv); - g_strfreev (strv); + _gs_prefs_set_themes (prefs, strv); + g_strfreev (strv); } else if (strcmp (key, KEY_ACTIVATE_DELAY) == 0) @@ -414,7 +414,7 @@ key_changed_cb (GSettings *settings, int delay; delay = g_settings_get_int (settings, key); - _gs_prefs_set_timeout (prefs, delay); + _gs_prefs_set_timeout (prefs, delay); } else if (strcmp (key, KEY_POWER_DELAY) == 0) @@ -422,7 +422,7 @@ key_changed_cb (GSettings *settings, int delay; delay = g_settings_get_int (settings, key); - _gs_prefs_set_power_timeout (prefs, delay); + _gs_prefs_set_power_timeout (prefs, delay); } else if (strcmp (key, KEY_LOCK_DELAY) == 0) @@ -430,22 +430,22 @@ key_changed_cb (GSettings *settings, int delay; delay = g_settings_get_int (settings, key); - _gs_prefs_set_lock_timeout (prefs, delay); + _gs_prefs_set_lock_timeout (prefs, delay); } else if (strcmp (key, KEY_IDLE_ACTIVATION_ENABLED) == 0) { gboolean enabled; enabled = g_settings_get_boolean (settings, key); - _gs_prefs_set_idle_activation_enabled (prefs, enabled); + _gs_prefs_set_idle_activation_enabled (prefs, enabled); } else if (strcmp (key, KEY_LOCK_ENABLED) == 0) { - gboolean enabled; + gboolean enabled; enabled = g_settings_get_boolean (settings, key); - _gs_prefs_set_lock_enabled (prefs, enabled); + _gs_prefs_set_lock_enabled (prefs, enabled); } else if (strcmp (key, KEY_LOCK_DISABLE) == 0) @@ -453,7 +453,7 @@ key_changed_cb (GSettings *settings, gboolean disabled; disabled = g_settings_get_boolean (settings, key); - _gs_prefs_set_lock_disabled (prefs, disabled); + _gs_prefs_set_lock_disabled (prefs, disabled); } else if (strcmp (key, KEY_USER_SWITCH_DISABLE) == 0) @@ -461,7 +461,7 @@ key_changed_cb (GSettings *settings, gboolean disabled; disabled = g_settings_get_boolean (settings, key); - _gs_prefs_set_user_switch_disabled (prefs, disabled); + _gs_prefs_set_user_switch_disabled (prefs, disabled); } else if (strcmp (key, KEY_CYCLE_DELAY) == 0) @@ -469,7 +469,7 @@ key_changed_cb (GSettings *settings, int delay; delay = g_settings_get_int (settings, key); - _gs_prefs_set_cycle_timeout (prefs, delay); + _gs_prefs_set_cycle_timeout (prefs, delay); } else if (strcmp (key, KEY_KEYBOARD_ENABLED) == 0) @@ -477,15 +477,16 @@ key_changed_cb (GSettings *settings, gboolean enabled; enabled = g_settings_get_boolean (settings, key); - _gs_prefs_set_keyboard_enabled (prefs, enabled); + _gs_prefs_set_keyboard_enabled (prefs, enabled); } else if (strcmp (key, KEY_KEYBOARD_COMMAND) == 0) { - const char *command; + char *command; command = g_settings_get_string (settings, key); - _gs_prefs_set_keyboard_command (prefs, command); + _gs_prefs_set_keyboard_command (prefs, command); + g_free (command); } else if (strcmp (key, KEY_STATUS_MESSAGE_ENABLED) == 0) @@ -493,7 +494,7 @@ key_changed_cb (GSettings *settings, gboolean enabled; enabled = g_settings_get_boolean (settings, key); - _gs_prefs_set_status_message_enabled (prefs, enabled); + _gs_prefs_set_status_message_enabled (prefs, enabled); } else if (strcmp (key, KEY_LOGOUT_ENABLED) == 0) @@ -501,7 +502,7 @@ key_changed_cb (GSettings *settings, gboolean enabled; enabled = g_settings_get_boolean (settings, key); - _gs_prefs_set_logout_enabled (prefs, enabled); + _gs_prefs_set_logout_enabled (prefs, enabled); } else if (strcmp (key, KEY_LOGOUT_DELAY) == 0) @@ -509,23 +510,22 @@ key_changed_cb (GSettings *settings, int delay; delay = g_settings_get_int (settings, key); - _gs_prefs_set_logout_timeout (prefs, delay); + _gs_prefs_set_logout_timeout (prefs, delay); } else if (strcmp (key, KEY_LOGOUT_COMMAND) == 0) { - const char *command; - + char *command; command = g_settings_get_string (settings, key); - _gs_prefs_set_logout_command (prefs, command); - + _gs_prefs_set_logout_command (prefs, command); + g_free (command); } else if (strcmp (key, KEY_USER_SWITCH_ENABLED) == 0) { gboolean enabled; enabled = g_settings_get_boolean (settings, key); - _gs_prefs_set_user_switch_enabled (prefs, enabled); + _gs_prefs_set_user_switch_enabled (prefs, enabled); } else @@ -541,16 +541,16 @@ gs_prefs_init (GSPrefs *prefs) { prefs->priv = GS_PREFS_GET_PRIVATE (prefs); - prefs->priv->settings = g_settings_new (GSETTINGS_SCHEMA); - g_signal_connect (prefs->priv->settings, - "changed", - G_CALLBACK (key_changed_cb), - prefs); - prefs->priv->lockdown = g_settings_new (LOCKDOWN_SETTINGS_SCHEMA); - g_signal_connect (prefs->priv->lockdown, - "changed", - G_CALLBACK (key_changed_cb), - prefs); + prefs->priv->settings = g_settings_new (GSETTINGS_SCHEMA); + g_signal_connect (prefs->priv->settings, + "changed", + G_CALLBACK (key_changed_cb), + prefs); + prefs->priv->lockdown_settings = g_settings_new (LOCKDOWN_SETTINGS_SCHEMA); + g_signal_connect (prefs->priv->lockdown_settings, + "changed", + G_CALLBACK (key_changed_cb), + prefs); prefs->idle_activation_enabled = TRUE; prefs->lock_enabled = TRUE; prefs->lock_disabled = FALSE; @@ -586,10 +586,10 @@ gs_prefs_finalize (GObject *object) prefs->priv->settings = NULL; } - if (prefs->priv->lockdown) { - g_object_unref (prefs->priv->lockdown); - prefs->priv->lockdown = NULL; - } + if (prefs->priv->lockdown_settings) { + g_object_unref (prefs->priv->lockdown_settings); + prefs->priv->lockdown_settings = NULL; + } if (prefs->themes) { |