[Xfce4-commits] [apps/mousepad] 03/45: Replace MousepadPreferences with GSettings

noreply at xfce.org noreply at xfce.org
Fri Jul 11 13:03:08 CEST 2014


This is an automated email from the git hooks/post-receive script.

mbrush pushed a commit to branch master
in repository apps/mousepad.

commit 0393b733eb4021b17912e38891e42aad1df447a4
Author: Matthew Brush <mbrush at codebrainz.ca>
Date:   Sun Jul 6 02:44:27 2014 -0700

    Replace MousepadPreferences with GSettings
---
 mousepad/Makefile.am                   |    2 -
 mousepad/mousepad-application.c        |    1 +
 mousepad/mousepad-document.c           |   25 +-
 mousepad/mousepad-encoding-dialog.c    |    1 -
 mousepad/mousepad-preferences.c        |  652 --------------------------------
 mousepad/mousepad-preferences.h        |   38 --
 mousepad/mousepad-print.c              |    1 -
 mousepad/mousepad-replace-dialog.c     |   31 +-
 mousepad/mousepad-search-bar.c         |   15 +-
 mousepad/mousepad-settings.c           |    2 +-
 mousepad/mousepad-window.c             |   71 ++--
 mousepad/org.xfce.Mousepad.gschema.xml |    4 +-
 12 files changed, 56 insertions(+), 787 deletions(-)

diff --git a/mousepad/Makefile.am b/mousepad/Makefile.am
index 28c536e..b8bdf28 100644
--- a/mousepad/Makefile.am
+++ b/mousepad/Makefile.am
@@ -33,8 +33,6 @@ mousepad_SOURCES = \
 	mousepad-encoding-dialog.h \
 	mousepad-file.c \
 	mousepad-file.h \
-	mousepad-preferences.c \
-	mousepad-preferences.h \
 	mousepad-print.c \
 	mousepad-print.h \
 	mousepad-private.h \
diff --git a/mousepad/mousepad-application.c b/mousepad/mousepad-application.c
index 4ccfa74..24c9e64 100644
--- a/mousepad/mousepad-application.c
+++ b/mousepad/mousepad-application.c
@@ -19,6 +19,7 @@
 #endif
 
 #include <mousepad/mousepad-private.h>
+#include <mousepad/mousepad-settings.h>
 #include <mousepad/mousepad-application.h>
 #include <mousepad/mousepad-document.h>
 #include <mousepad/mousepad-replace-dialog.h>
diff --git a/mousepad/mousepad-document.c b/mousepad/mousepad-document.c
index d248dc9..1f6cb62 100644
--- a/mousepad/mousepad-document.c
+++ b/mousepad/mousepad-document.c
@@ -29,11 +29,11 @@
 #endif
 
 #include <mousepad/mousepad-private.h>
+#include <mousepad/mousepad-settings.h>
 #include <mousepad/mousepad-util.h>
 #include <mousepad/mousepad-document.h>
 #include <mousepad/mousepad-marshal.h>
 #include <mousepad/mousepad-view.h>
-#include <mousepad/mousepad-preferences.h>
 #include <mousepad/mousepad-window.h>
 
 
@@ -180,7 +180,6 @@ mousepad_document_init (MousepadDocument *document)
   gchar                *font_name, *color_scheme;
   gint                  tab_size;
   GtkSourceStyleScheme *scheme = NULL;
-  MousepadPreferences  *preferences;
 
   /* private structure */
   document->priv = MOUSEPAD_DOCUMENT_GET_PRIVATE (document);
@@ -217,22 +216,14 @@ mousepad_document_init (MousepadDocument *document)
   target_list = gtk_drag_dest_get_target_list (GTK_WIDGET (document->textview));
   gtk_target_list_add_table (target_list, drop_targets, G_N_ELEMENTS (drop_targets));
 
-  /* preferences */
-  preferences = mousepad_preferences_get ();
-
   /* read all the default settings */
-  g_object_get (G_OBJECT (preferences),
-                "view-word-wrap", &word_wrap,
-                "view-line-numbers", &line_numbers,
-                "view-auto-indent", &auto_indent,
-                "view-font-name", &font_name,
-                "view-tab-size", &tab_size,
-                "view-insert-spaces", &insert_spaces,
-                "view-color-scheme", &color_scheme,
-                NULL);
-
-  /* release the preferences */
-  g_object_unref (G_OBJECT (preferences));
+  word_wrap = g_settings_get_boolean (MOUSEPAD_GSETTINGS, "view-word-wrap");
+  line_numbers = g_settings_get_boolean (MOUSEPAD_GSETTINGS, "view-line-numbers");
+  auto_indent = g_settings_get_boolean (MOUSEPAD_GSETTINGS, "view-auto-indent");
+  font_name = g_settings_get_string (MOUSEPAD_GSETTINGS, "view-font-name");
+  tab_size = g_settings_get_int (MOUSEPAD_GSETTINGS, "view-tab-size");
+  insert_spaces = g_settings_get_boolean (MOUSEPAD_GSETTINGS, "view-insert-spaces");
+  color_scheme = g_settings_get_string (MOUSEPAD_GSETTINGS, "view-color-scheme");
 
   /* set all the settings */
   mousepad_document_set_word_wrap (document, word_wrap);
diff --git a/mousepad/mousepad-encoding-dialog.c b/mousepad/mousepad-encoding-dialog.c
index 31d1c0d..6828452 100644
--- a/mousepad/mousepad-encoding-dialog.c
+++ b/mousepad/mousepad-encoding-dialog.c
@@ -29,7 +29,6 @@
 #include <mousepad/mousepad-document.h>
 #include <mousepad/mousepad-encoding.h>
 #include <mousepad/mousepad-encoding-dialog.h>
-#include <mousepad/mousepad-preferences.h>
 #include <mousepad/mousepad-util.h>
 
 
diff --git a/mousepad/mousepad-preferences.c b/mousepad/mousepad-preferences.c
deleted file mode 100644
index 90a84d6..0000000
--- a/mousepad/mousepad-preferences.c
+++ /dev/null
@@ -1,652 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * 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
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-
-#include <glib-object.h>
-
-#include <mousepad/mousepad-private.h>
-#include <mousepad/mousepad-util.h>
-#include <mousepad/mousepad-preferences.h>
-
-#define GROUP_NAME "Configuration"
-
-
-
-enum
-{
-  PROP_0,
-
-  /* search preferences */
-  PROP_SEARCH_DIRECTION,
-  PROP_SEARCH_MATCH_CASE,
-  PROP_SEARCH_MATCH_WHOLE_WORD,
-  PROP_SEARCH_REPLACE_ALL_LOCATION,
-
-  /* textview preferences */
-  PROP_VIEW_AUTO_INDENT,
-  PROP_VIEW_FONT_NAME,
-  PROP_VIEW_LINE_NUMBERS,
-  PROP_VIEW_TAB_WIDTH,
-  PROP_VIEW_TABS_AS_SPACES,
-  PROP_VIEW_WORD_WRAP,
-  PROP_VIEW_COLOR_SCHEME,
-
-  /* window preferences */
-  PROP_WINDOW_HEIGHT,
-  PROP_WINDOW_WIDTH,
-  PROP_WINDOW_STATUSBAR_VISIBLE,
-
-  /* hidden settings */
-  PROP_MISC_ALWAYS_SHOW_TABS,
-  PROP_MISC_CYCLE_TABS,
-  PROP_MISC_DEFAULT_TAB_SIZES,
-  PROP_MISC_PATH_IN_TITLE,
-  PROP_MISC_RECENT_MENU_ITEMS,
-  PROP_MISC_REMEMBER_GEOMETRY,
-  N_PROPERTIES
-};
-
-
-
-static void     mousepad_preferences_finalize           (GObject                  *object);
-static void     mousepad_preferences_get_property       (GObject                  *object,
-                                                         guint                     prop_id,
-                                                         GValue                   *value,
-                                                         GParamSpec               *pspec);
-static void     mousepad_preferences_set_property       (GObject                  *object,
-                                                         guint                     prop_id,
-                                                         const GValue             *value,
-                                                         GParamSpec               *pspec);
-#ifndef NDEBUG
-static void     mousepad_preferences_check_option_name  (GParamSpec               *pspec);
-#endif
-static void     mousepad_preferences_load               (MousepadPreferences      *preferences);
-static void     mousepad_preferences_store              (MousepadPreferences      *preferences);
-static gboolean mousepad_preferences_store_idle         (gpointer                  user_data);
-static void     mousepad_preferences_store_idle_destroy (gpointer                  user_data);
-
-struct _MousepadPreferencesClass
-{
-  GObjectClass __parent__;
-};
-
-struct _MousepadPreferences
-{
-  GObject  __parent__;
-
-  /* all the properties stored in the object */
-  GValue   values[N_PROPERTIES];
-
-  /* idle save timer id */
-  gint     store_idle_id;
-};
-
-
-
-G_DEFINE_TYPE (MousepadPreferences, mousepad_preferences, G_TYPE_OBJECT);
-
-
-
-static void
-mousepad_preferences_class_init (MousepadPreferencesClass *klass)
-{
-  GObjectClass *gobject_class;
-
-  gobject_class = G_OBJECT_CLASS (klass);
-  gobject_class->finalize = mousepad_preferences_finalize;
-  gobject_class->get_property = mousepad_preferences_get_property;
-  gobject_class->set_property = mousepad_preferences_set_property;
-
-  /**
-   * Search Preferences
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_SEARCH_DIRECTION,
-                                   g_param_spec_int ("search-direction",
-                                                     "SearchDirection",
-                                                     NULL,
-                                                     0, 2, 1,
-                                                     MOUSEPAD_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_SEARCH_MATCH_CASE,
-                                   g_param_spec_boolean ("search-match-case",
-                                                         "SearchMatchCase",
-                                                         NULL,
-                                                         FALSE,
-                                                         MOUSEPAD_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_SEARCH_MATCH_WHOLE_WORD,
-                                   g_param_spec_boolean ("search-match-whole-word",
-                                                         "SearchMatchWholeWord",
-                                                         NULL,
-                                                         FALSE,
-                                                         MOUSEPAD_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_SEARCH_REPLACE_ALL_LOCATION,
-                                   g_param_spec_int ("search-replace-all-location",
-                                                     "SearchReplaceAllLocation",
-                                                     NULL,
-                                                     0, 2, 1,
-                                                     MOUSEPAD_PARAM_READWRITE));
-
-  /**
-   * Textview Preferences
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_VIEW_AUTO_INDENT,
-                                   g_param_spec_boolean ("view-auto-indent",
-                                                         "ViewAutoIndent",
-                                                         NULL,
-                                                         FALSE,
-                                                         MOUSEPAD_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_VIEW_FONT_NAME,
-                                   g_param_spec_string ("view-font-name",
-                                                        "ViewFontName",
-                                                        NULL,
-                                                        "Monospace",
-                                                        MOUSEPAD_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_VIEW_LINE_NUMBERS,
-                                   g_param_spec_boolean ("view-line-numbers",
-                                                         "ViewLineNumbers",
-                                                         NULL,
-                                                         FALSE,
-                                                         MOUSEPAD_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_VIEW_TAB_WIDTH,
-                                   g_param_spec_int ("view-tab-size",
-                                                     "ViewTabSize",
-                                                     NULL,
-                                                     1, 32, 8,
-                                                     MOUSEPAD_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_VIEW_TABS_AS_SPACES,
-                                   g_param_spec_boolean ("view-insert-spaces",
-                                                         "ViewInsertSpaces",
-                                                         NULL,
-                                                         FALSE,
-                                                         MOUSEPAD_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_VIEW_WORD_WRAP,
-                                   g_param_spec_boolean ("view-word-wrap",
-                                                         "ViewWordWrap",
-                                                         NULL,
-                                                         FALSE,
-                                                         MOUSEPAD_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_VIEW_COLOR_SCHEME,
-                                   g_param_spec_string ("view-color-scheme",
-                                                        "ViewColorScheme",
-                                                        NULL,
-                                                        "none",
-                                                        MOUSEPAD_PARAM_READWRITE));
-
-
-  /**
-   * Window Preferences
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_WINDOW_HEIGHT,
-                                   g_param_spec_int ("window-height",
-                                                     "WindowHeight",
-                                                     NULL,
-                                                     1, G_MAXINT, 480,
-                                                     MOUSEPAD_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_WINDOW_WIDTH,
-                                   g_param_spec_int ("window-width",
-                                                     "WindowWidth",
-                                                     NULL,
-                                                     1, G_MAXINT, 640,
-                                                     MOUSEPAD_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_WINDOW_STATUSBAR_VISIBLE,
-                                   g_param_spec_boolean ("window-statusbar-visible",
-                                                         "WindowStatusbarVisible",
-                                                         NULL,
-                                                         TRUE,
-                                                         MOUSEPAD_PARAM_READWRITE));
-
-
-  /**
-   * Hidden Preferences
-   **/
-  g_object_class_install_property (gobject_class,
-                                   PROP_MISC_ALWAYS_SHOW_TABS,
-                                   g_param_spec_boolean ("misc-always-show-tabs",
-                                                         "MiscAlwaysShowTabs",
-                                                         NULL,
-                                                         FALSE,
-                                                         MOUSEPAD_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_MISC_CYCLE_TABS,
-                                   g_param_spec_boolean ("misc-cycle-tabs",
-                                                         "MiscCycleTabs",
-                                                         NULL,
-                                                         FALSE,
-                                                         MOUSEPAD_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_MISC_DEFAULT_TAB_SIZES,
-                                   g_param_spec_string ("misc-default-tab-sizes",
-                                                        "MiscDefaultTabSizes",
-                                                        NULL,
-                                                        "2,3,4,8",
-                                                        MOUSEPAD_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_MISC_PATH_IN_TITLE,
-                                   g_param_spec_boolean ("misc-path-in-title",
-                                                         "MiscPathInTitle",
-                                                         NULL,
-                                                         FALSE,
-                                                         MOUSEPAD_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_MISC_RECENT_MENU_ITEMS,
-                                   g_param_spec_int ("misc-recent-menu-items",
-                                                     "MiscRecentMenuItems",
-                                                     NULL,
-                                                     1, 100, 10,
-                                                     MOUSEPAD_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_MISC_REMEMBER_GEOMETRY,
-                                   g_param_spec_boolean ("misc-remember-geometry",
-                                                         "MiscRememberGeometry",
-                                                         NULL,
-                                                         TRUE,
-                                                         MOUSEPAD_PARAM_READWRITE));
-}
-
-
-
-static void
-mousepad_preferences_init (MousepadPreferences *preferences)
-{
-  /* load the settings */
-  mousepad_preferences_load (preferences);
-}
-
-
-
-static void
-mousepad_preferences_finalize (GObject *object)
-{
-  MousepadPreferences *preferences = MOUSEPAD_PREFERENCES (object);
-  guint                n;
-
-  /* flush preferences */
-  if (G_UNLIKELY (preferences->store_idle_id != 0))
-    {
-      g_source_remove (preferences->store_idle_id);
-      mousepad_preferences_store (preferences);
-    }
-  /* release the property values */
-  for (n = 1; n < N_PROPERTIES; ++n)
-    if (G_IS_VALUE (preferences->values + n))
-      g_value_unset (preferences->values + n);
-
-  (*G_OBJECT_CLASS (mousepad_preferences_parent_class)->finalize) (object);
-}
-
-
-
-static void
-mousepad_preferences_get_property (GObject    *object,
-                                   guint       prop_id,
-                                   GValue     *value,
-                                   GParamSpec *pspec)
-{
-  MousepadPreferences *preferences = MOUSEPAD_PREFERENCES (object);
-  GValue              *src = preferences->values + prop_id;
-
-  if (G_LIKELY (G_IS_VALUE (src)))
-    g_value_copy (src, value);
-  else
-    g_param_value_set_default (pspec, value);
-}
-
-
-
-static void
-mousepad_preferences_set_property (GObject      *object,
-                                   guint         prop_id,
-                                   const GValue *value,
-                                   GParamSpec   *pspec)
-{
-  MousepadPreferences *preferences = MOUSEPAD_PREFERENCES (object);
-  GValue              *dst = preferences->values + prop_id;
-
-  /* initialize value if needed */
-  if (G_UNLIKELY (G_IS_VALUE (dst) == FALSE))
-    {
-      g_value_init (dst, pspec->value_type);
-      g_param_value_set_default (pspec, dst);
-    }
-
-  /* compare the values */
-  if (g_param_values_cmp (pspec, value, dst) != 0)
-    {
-      /* copy the new value */
-      g_value_copy (value, dst);
-
-      /* queue a store */
-      mousepad_preferences_store (preferences);
-    }
-}
-
-
-
-#ifndef NDEBUG
-static void
-mousepad_preferences_check_option_name (GParamSpec *pspec)
-{
-  const gchar *name, *nick;
-  gchar       *option;
-
-  /* get property name and nick */
-  name = g_param_spec_get_name (pspec);
-  nick = g_param_spec_get_nick (pspec);
-
-  if (G_UNLIKELY (nick == NULL))
-    {
-      g_warning ("The nick name of %s is NULL", name);
-    }
-  else
-    {
-      /* get option name */
-      option = mousepad_util_config_name (name);
-
-      /* compare the strings */
-      if (G_UNLIKELY (!option || strcmp (option, nick) != 0))
-        g_warning ("The option name (%s) and nick name (%s) of property %s do not match", option, nick, name);
-
-      /* cleanup */
-      g_free (option);
-    }
-}
-#endif
-
-
-
-static void
-mousepad_preferences_load (MousepadPreferences *preferences)
-{
-  gchar          *string;
-  GParamSpec    **pspecs;
-  GParamSpec     *pspec;
-  GParamSpecInt  *ispec;
-  GKeyFile       *keyfile;
-  gchar          *filename;
-  GValue         *dst;
-  guint           nspecs;
-  guint           n;
-  gint            integer;
-
-  /* get the save location, leave when there if no file found */
-  filename = mousepad_util_get_save_location (MOUSEPAD_RC_RELPATH, FALSE);
-  if (G_UNLIKELY (filename == NULL))
-    return;
-
-  /* create a new key file */
-  keyfile = g_key_file_new ();
-
-  /* open the config file */
-  if (G_LIKELY (g_key_file_load_from_file (keyfile, filename, G_KEY_FILE_NONE, NULL)))
-    {
-      /* freeze notification signals */
-      g_object_freeze_notify (G_OBJECT (preferences));
-
-      /* get all the properties in the class */
-      pspecs = g_object_class_list_properties (G_OBJECT_GET_CLASS (preferences), &nspecs);
-
-      for (n = 0; n < nspecs; n++)
-        {
-          /* get the pspec */
-          pspec = pspecs[n];
-
-          /* get the pspec destination value and initialize it */
-          dst = preferences->values + (n + 1);
-          g_value_init (dst, pspec->value_type);
-
-#ifndef NDEBUG
-          /* check nick name with generated option name */
-          mousepad_preferences_check_option_name (pspec);
-#endif
-
-          /* read the propert value from the key file */
-          string = g_key_file_get_value (keyfile, GROUP_NAME, g_param_spec_get_nick (pspec), NULL);
-          if (G_UNLIKELY (string == NULL || *string == '\0'))
-            goto setdefault;
-
-          if (pspec->value_type == G_TYPE_STRING)
-            {
-              /* set string as the value */
-              g_value_take_string (dst, string);
-
-              /* don't free the string */
-              string = NULL;
-            }
-          else if (pspec->value_type == G_TYPE_INT)
-            {
-              /* get integer spec */
-              ispec = G_PARAM_SPEC_INT (pspec);
-
-              /* get the value and clamp it */
-              integer = CLAMP (atoi (string), ispec->minimum, ispec->maximum);
-
-              /* set the integer */
-              g_value_set_int (dst, integer);
-            }
-          else if (pspec->value_type == G_TYPE_BOOLEAN)
-            {
-              /* set the boolean */
-              g_value_set_boolean (dst, (strcmp (string, "false") != 0));
-            }
-          else
-            {
-              /* print warning */
-              g_warning ("Failed to load property \"%s\"", pspec->name);
-
-              setdefault:
-
-              /* set default */
-              g_param_value_set_default (pspec, dst);
-            }
-
-          /* cleanup */
-          g_free (string);
-        }
-
-      /* cleanup the specs */
-      g_free (pspecs);
-
-      /* allow notifications again */
-      g_object_thaw_notify (G_OBJECT (preferences));
-    }
-
-  /* free the key file */
-  g_key_file_free (keyfile);
-
-  /* cleanup filename */
-  g_free (filename);
-}
-
-
-
-static void
-mousepad_preferences_store (MousepadPreferences *preferences)
-{
-  if (preferences->store_idle_id == 0)
-    {
-      preferences->store_idle_id = g_idle_add_full (G_PRIORITY_LOW, mousepad_preferences_store_idle,
-                                                    preferences, mousepad_preferences_store_idle_destroy);
-    }
-}
-
-
-
-static gboolean
-mousepad_preferences_store_idle (gpointer user_data)
-{
-  MousepadPreferences  *preferences = MOUSEPAD_PREFERENCES (user_data);
-  GParamSpec          **pspecs;
-  GParamSpec           *pspec;
-  GKeyFile             *keyfile;
-  gchar                *filename;
-  GValue               *value;
-  guint                 nspecs;
-  guint                 n;
-  const gchar          *nick;
-
-  /* get the config filename */
-  filename = mousepad_util_get_save_location (MOUSEPAD_RC_RELPATH, TRUE);
-
-  /* leave when no filename is returned */
-  if (G_UNLIKELY (filename == NULL))
-    return FALSE;
-
-  /* create an empty key file */
-  keyfile = g_key_file_new ();
-
-  /* try to load the file contents, no worries if this fails */
-  g_key_file_load_from_file (keyfile, filename, G_KEY_FILE_NONE, NULL);
-
-  /* get the list of properties in the class */
-  pspecs = g_object_class_list_properties (G_OBJECT_GET_CLASS (preferences), &nspecs);
-
-  for (n = 0; n < nspecs; n++)
-    {
-      /* get the pspec */
-      pspec = pspecs[n];
-
-      /* get the value */
-      value = preferences->values + (n + 1);
-
-      /* continue if the value is not initialized */
-      if (G_UNLIKELY (G_IS_VALUE (value) == FALSE))
-        continue;
-
-      /* get nick name */
-      nick = g_param_spec_get_nick (pspec);
-
-      if (pspec->value_type == G_TYPE_STRING)
-        {
-          /* store the string */
-          if (g_value_get_string (value) != NULL)
-            g_key_file_set_value (keyfile, GROUP_NAME, nick, g_value_get_string (value));
-        }
-      else if (pspec->value_type == G_TYPE_INT)
-        {
-          /* store the interger */
-          g_key_file_set_integer (keyfile, GROUP_NAME, nick, g_value_get_int (value));
-        }
-      else if (pspec->value_type == G_TYPE_BOOLEAN)
-        {
-          /* store the boolean */
-          g_key_file_set_boolean (keyfile, GROUP_NAME, nick, g_value_get_boolean (value));
-        }
-      else
-        {
-          g_warning ("Failed to save property \"%s\"", pspec->name);
-        }
-    }
-
-  /* cleanup the specs */
-  g_free (pspecs);
-
-  /* save the keyfile */
-  mousepad_util_save_key_file (keyfile, filename);
-
-  /* close the key file */
-  g_key_file_free (keyfile);
-
-  /* cleanup */
-  g_free (filename);
-
-  return FALSE;
-}
-
-
-
-static void
-mousepad_preferences_store_idle_destroy (gpointer user_data)
-{
-  MOUSEPAD_PREFERENCES (user_data)->store_idle_id = 0;
-}
-
-
-
-/**
- * mousepad_preferences_get:
- *
- * Queries the global #MousepadPreferences instance, which is shared
- * by all modules. The function automatically takes a reference
- * for the caller, so you'll need to call g_object_unref() when
- * you're done with it.
- *
- * Return value: the global #MousepadPreferences instance.
- **/
-MousepadPreferences*
-mousepad_preferences_get (void)
-{
-  static MousepadPreferences *preferences = NULL;
-
-  if (G_UNLIKELY (preferences == NULL))
-    {
-      preferences = g_object_new (MOUSEPAD_TYPE_PREFERENCES, NULL);
-      g_object_add_weak_pointer (G_OBJECT (preferences), (gpointer) &preferences);
-    }
-  else
-    {
-      g_object_ref (G_OBJECT (preferences));
-    }
-
-  return preferences;
-}
diff --git a/mousepad/mousepad-preferences.h b/mousepad/mousepad-preferences.h
deleted file mode 100644
index 31302b7..0000000
--- a/mousepad/mousepad-preferences.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * 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
- */
-
-#ifndef __MOUSEPAD_PREFERENCIES_H__
-#define __MOUSEPAD_PREFERENCIES_H__
-
-G_BEGIN_DECLS
-
-#define MOUSEPAD_TYPE_PREFERENCES             (mousepad_preferences_get_type ())
-#define MOUSEPAD_PREFERENCES(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), MOUSEPAD_TYPE_PREFERENCES, MousepadPreferences))
-#define MOUSEPAD_PREFERENCES_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), MOUSEPAD_TYPE_PREFERENCES, MousepadPreferencesClass))
-#define MOUSEPAD_IS_PREFERENCES(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MOUSEPAD_TYPE_PREFERENCES))
-#define MOUSEPAD_IS_PREFERENCES_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), MOUSEPAD_TYPE_PREFERENCES))
-#define MOUSEPAD_PREFERENCES_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), MOUSEPAD_TYPE_PREFERENCES, MousepadPreferencesClass))
-
-typedef struct _MousepadPreferencesClass MousepadPreferencesClass;
-typedef struct _MousepadPreferences      MousepadPreferences;
-
-GType                mousepad_preferences_get_type (void) G_GNUC_CONST;
-
-MousepadPreferences *mousepad_preferences_get      (void);
-
-G_END_DECLS
-
-#endif /* !__MOUSEPAD_PREFERENCIES_H__ */
diff --git a/mousepad/mousepad-print.c b/mousepad/mousepad-print.c
index d9b398f..29625cf 100644
--- a/mousepad/mousepad-print.c
+++ b/mousepad/mousepad-print.c
@@ -22,7 +22,6 @@
 #include <cairo.h>
 
 #include <mousepad/mousepad-private.h>
-#include <mousepad/mousepad-preferences.h>
 #include <mousepad/mousepad-document.h>
 #include <mousepad/mousepad-util.h>
 #include <mousepad/mousepad-print.h>
diff --git a/mousepad/mousepad-replace-dialog.c b/mousepad/mousepad-replace-dialog.c
index 8911b5a..1f29863 100644
--- a/mousepad/mousepad-replace-dialog.c
+++ b/mousepad/mousepad-replace-dialog.c
@@ -23,10 +23,10 @@
 #endif
 
 #include <mousepad/mousepad-private.h>
+#include <mousepad/mousepad-settings.h>
 #include <mousepad/mousepad-document.h>
 #include <mousepad/mousepad-replace-dialog.h>
 #include <mousepad/mousepad-dialogs.h>
-#include <mousepad/mousepad-preferences.h>
 #include <mousepad/mousepad-util.h>
 #include <mousepad/mousepad-marshal.h>
 
@@ -61,9 +61,6 @@ struct _MousepadReplaceDialog
 {
   GtkDialog __parent__;
 
-  /* mousepad preferences */
-  MousepadPreferences *preferences;
-
   /* dialog widgets */
   GtkWidget           *search_entry;
   GtkWidget           *replace_entry;
@@ -146,16 +143,11 @@ mousepad_replace_dialog_init (MousepadReplaceDialog *dialog)
   /* initialize some variables */
   dialog->replace_all = FALSE;
 
-  /* get the mousepad preferences */
-  dialog->preferences = mousepad_preferences_get ();
-
   /* read the preferences */
-  g_object_get (G_OBJECT (dialog->preferences),
-                "search-match-whole-word", &match_whole_word,
-                "search-match-case", &match_case,
-                "search-direction", &search_direction,
-                "search-replace-all-location", &replace_all_location,
-                NULL);
+  match_whole_word = g_settings_get_boolean (MOUSEPAD_GSETTINGS, "search-match-whole-word");
+  match_case = g_settings_get_boolean (MOUSEPAD_GSETTINGS, "search-match-case");
+  search_direction = g_settings_get_int (MOUSEPAD_GSETTINGS, "search-direction");
+  replace_all_location = g_settings_get_int (MOUSEPAD_GSETTINGS, "search-replace-all-location");
 
   /* set some flags */
   dialog->match_whole_word = match_whole_word;
@@ -313,10 +305,7 @@ mousepad_replace_dialog_unrealize (GtkWidget *widget)
 static void
 mousepad_replace_dialog_finalize (GObject *object)
 {
-  MousepadReplaceDialog *dialog = MOUSEPAD_REPLACE_DIALOG (object);
-
-  /* release the preferences */
-  g_object_unref (G_OBJECT (dialog->preferences));
+  /*MousepadReplaceDialog *dialog = MOUSEPAD_REPLACE_DIALOG (object);*/
 
   (*G_OBJECT_CLASS (mousepad_replace_dialog_parent_class)->finalize) (object);
 }
@@ -493,7 +482,7 @@ mousepad_replace_dialog_case_sensitive_toggled (GtkToggleButton       *button,
   dialog->match_case = gtk_toggle_button_get_active (button);
 
   /* save the setting */
-  g_object_set (G_OBJECT (dialog->preferences), "search-match-case", dialog->match_case, NULL);
+  g_settings_set_boolean (MOUSEPAD_GSETTINGS, "search-match-case", dialog->match_case);
 
   /* update dialog */
   mousepad_replace_dialog_changed (dialog);
@@ -509,7 +498,7 @@ mousepad_replace_dialog_whole_word_toggled (GtkToggleButton       *button,
   dialog->match_whole_word = gtk_toggle_button_get_active (button);
 
   /* save the setting */
-  g_object_set (G_OBJECT (dialog->preferences), "search-match-whole-word", dialog->match_whole_word, NULL);
+  g_settings_set_boolean (MOUSEPAD_GSETTINGS, "search-match-whole-word", dialog->match_whole_word);
 
   /* update dialog */
   mousepad_replace_dialog_changed (dialog);
@@ -553,7 +542,7 @@ mousepad_replace_dialog_search_location_changed (GtkComboBox           *combo,
   dialog->replace_all_location = gtk_combo_box_get_active (combo);
 
   /* save setting */
-  g_object_set (G_OBJECT (dialog->preferences), "search-replace-all-location", dialog->replace_all_location, NULL);
+  g_settings_set_int (MOUSEPAD_GSETTINGS, "search-replace-all-location", dialog->replace_all_location);
 
   /* update dialog */
   mousepad_replace_dialog_changed (dialog);
@@ -569,7 +558,7 @@ mousepad_replace_dialog_direction_changed (GtkComboBox           *combo,
   dialog->search_direction = gtk_combo_box_get_active (combo);
 
   /* save the last direction */
-  g_object_set (G_OBJECT (dialog->preferences), "search-direction", dialog->search_direction, NULL);
+  g_settings_set_int (MOUSEPAD_GSETTINGS, "search-direction", dialog->search_direction);
 
   /* update dialog */
   mousepad_replace_dialog_changed (dialog);
diff --git a/mousepad/mousepad-search-bar.c b/mousepad/mousepad-search-bar.c
index ab97fec..4885867 100644
--- a/mousepad/mousepad-search-bar.c
+++ b/mousepad/mousepad-search-bar.c
@@ -22,10 +22,10 @@
 #include <gdk/gdkkeysyms.h>
 
 #include <mousepad/mousepad-private.h>
+#include <mousepad/mousepad-settings.h>
 #include <mousepad/mousepad-marshal.h>
 #include <mousepad/mousepad-document.h>
 #include <mousepad/mousepad-search-bar.h>
-#include <mousepad/mousepad-preferences.h>
 #include <mousepad/mousepad-util.h>
 #include <mousepad/mousepad-window.h>
 
@@ -70,9 +70,6 @@ struct _MousepadSearchBar
 {
   GtkToolbar           __parent__;
 
-  /* preferences */
-  MousepadPreferences *preferences;
-
   /* text entry */
   GtkWidget           *entry;
 
@@ -164,11 +161,8 @@ mousepad_search_bar_init (MousepadSearchBar *bar)
   GtkToolItem *item;
   gboolean     match_case;
 
-  /* preferences */
-  bar->preferences = mousepad_preferences_get ();
-
   /* load some preferences */
-  g_object_get (G_OBJECT (bar->preferences), "search-match-case", &match_case, NULL);
+  match_case = g_settings_get_boolean (MOUSEPAD_GSETTINGS, "search-match-case");
 
   /* init variables */
   bar->highlight_id = 0;
@@ -262,9 +256,6 @@ mousepad_search_bar_finalize (GObject *object)
 {
   MousepadSearchBar *bar = MOUSEPAD_SEARCH_BAR (object);
 
-  /* release the preferences */
-  g_object_unref (G_OBJECT (bar->preferences));
-
   /* stop a running highlight timeout */
   if (bar->highlight_id != 0)
     g_source_remove (bar->highlight_id);
@@ -394,7 +385,7 @@ mousepad_search_bar_match_case_toggled (GtkWidget         *button,
   bar->match_case = active;
 
   /* save the setting */
-  g_object_set (G_OBJECT (bar->preferences), "search-match-case", active, NULL);
+  g_settings_set_boolean (MOUSEPAD_GSETTINGS, "search-match-case", active);
 
   /* search ahead with this new flags */
   mousepad_search_bar_entry_changed (NULL, bar);
diff --git a/mousepad/mousepad-settings.c b/mousepad/mousepad-settings.c
index 6bbbed3..678a579 100644
--- a/mousepad/mousepad-settings.c
+++ b/mousepad/mousepad-settings.c
@@ -98,7 +98,7 @@ mousepad_settings_update_gsettings_schema_dir (void)
 #else
       const gchar *pathsep = ";";
 #endif
-      new_value = g_strdup_printf("%s%s" MOUSEPAD_GSETTINGS_SCHEMA_DIR, old_value, pathsep);
+      new_value = g_strconcat (old_value, pathsep, MOUSEPAD_GSETTINGS_SCHEMA_DIR, NULL);
       g_setenv ("GSETTINGS_SCHEMA_DIR", new_value, TRUE);
       g_free (new_value);
     }
diff --git a/mousepad/mousepad-window.c b/mousepad/mousepad-window.c
index b789d71..d958b1a 100644
--- a/mousepad/mousepad-window.c
+++ b/mousepad/mousepad-window.c
@@ -34,11 +34,11 @@
 #include <glib/gstdio.h>
 
 #include <mousepad/mousepad-private.h>
+#include <mousepad/mousepad-settings.h>
 #include <mousepad/mousepad-application.h>
 #include <mousepad/mousepad-marshal.h>
 #include <mousepad/mousepad-document.h>
 #include <mousepad/mousepad-dialogs.h>
-#include <mousepad/mousepad-preferences.h>
 #include <mousepad/mousepad-replace-dialog.h>
 #include <mousepad/mousepad-encoding-dialog.h>
 #include <mousepad/mousepad-search-bar.h>
@@ -359,9 +359,6 @@ struct _MousepadWindow
 {
   GtkWindow __parent__;
 
-  /* mousepad preferences */
-  MousepadPreferences *preferences;
-
   /* the current active document */
   MousepadDocument    *active;
 
@@ -459,12 +456,12 @@ static const GtkActionEntry action_entries[] =
     { "tab-size-menu", NULL, N_("Tab _Size"), NULL, NULL, NULL, },
     { "language-menu", NULL, N_("_Filetype"), NULL, NULL, NULL, },
 
-  { "navigation-menu", NULL, N_("_Navigation"), NULL, },
+  { "navigation-menu", NULL, N_("_Navigation"), NULL, NULL, NULL, },
     { "back", GTK_STOCK_GO_BACK, N_("_Previous Tab"), "<control>Page_Up", N_("Select the previous tab"), G_CALLBACK (mousepad_window_action_prev_tab), },
     { "forward", GTK_STOCK_GO_FORWARD, N_("_Next Tab"), "<control>Page_Down", N_("Select the next tab"), G_CALLBACK (mousepad_window_action_next_tab), },
     { "go-to", GTK_STOCK_JUMP_TO, N_("_Go to..."), "<control>G", N_("Go to a specific location in the document"), G_CALLBACK (mousepad_window_action_go_to_position), },
 
-  { "help-menu", NULL, N_("_Help"), NULL, },
+  { "help-menu", NULL, N_("_Help"), NULL, NULL, NULL },
     { "contents", GTK_STOCK_HELP, N_ ("_Contents"), "F1", N_("Display the Mousepad user manual"), G_CALLBACK (mousepad_window_action_contents), },
     { "about", GTK_STOCK_ABOUT, NULL, NULL, N_("About this application"), G_CALLBACK (mousepad_window_action_about), }
 };
@@ -570,9 +567,6 @@ mousepad_window_init (MousepadWindow *window)
   /* increase clipboard history ref count */
   clipboard_history_ref_count++;
 
-  /* add the preferences to the window */
-  window->preferences = mousepad_preferences_get ();
-
   /* signal for handling the window delete event */
   g_signal_connect (G_OBJECT (window), "delete-event", G_CALLBACK (mousepad_window_delete_event), NULL);
 
@@ -587,11 +581,9 @@ mousepad_window_init (MousepadWindow *window)
   g_closure_sink (window->menu_item_deselected_closure);
 
   /* read settings from the preferences */
-  g_object_get (G_OBJECT (window->preferences),
-                "window-width", &width,
-                "window-height", &height,
-                "window-statusbar-visible", &statusbar_visible,
-                NULL);
+  width = g_settings_get_int (MOUSEPAD_GSETTINGS, "window-width");
+  height = g_settings_get_int (MOUSEPAD_GSETTINGS, "window-height");
+  statusbar_visible = g_settings_get_boolean (MOUSEPAD_GSETTINGS, "window-statusbar-visible");
 
   /* set the default window size */
   gtk_window_set_default_size (GTK_WINDOW (window), width, height);
@@ -755,9 +747,6 @@ mousepad_window_finalize (GObject *object)
   /* release the action group */
   g_object_unref (G_OBJECT (window->action_group));
 
-  /* release the preferences reference */
-  g_object_unref (G_OBJECT (window->preferences));
-
   /* free clipboard history if needed */
   if (clipboard_history_ref_count == 0 && clipboard_history != NULL)
     {
@@ -904,7 +893,7 @@ mousepad_window_save_geometry_timer (gpointer user_data)
   GDK_THREADS_ENTER ();
 
   /* check if we should remember the window geometry */
-  g_object_get (G_OBJECT (window->preferences), "misc-remember-geometry", &remember_geometry, NULL);
+  remember_geometry = g_settings_get_boolean (MOUSEPAD_GSETTINGS, "misc-remember-geometry");
   if (G_LIKELY (remember_geometry))
     {
       /* check if the window is still visible */
@@ -920,9 +909,8 @@ mousepad_window_save_geometry_timer (gpointer user_data)
               gtk_window_get_size (GTK_WINDOW (window), &width, &height);
 
               /* ...and remember them as default for new windows */
-              g_object_set (G_OBJECT (window->preferences),
-                            "window-width", width,
-                            "window-height", height, NULL);
+              g_settings_set_int (MOUSEPAD_GSETTINGS, "window-width", width);
+              g_settings_set_int (MOUSEPAD_GSETTINGS, "window-height", height);
             }
         }
     }
@@ -1281,7 +1269,7 @@ mousepad_window_set_title (MousepadWindow *window)
   mousepad_return_if_fail (MOUSEPAD_IS_WINDOW (window));
 
   /* whether to show the full path */
-  g_object_get (G_OBJECT (window->preferences), "misc-path-in-title", &show_full_path, NULL);
+  show_full_path = g_settings_get_boolean (MOUSEPAD_GSETTINGS, "misc-path-in-title");
 
   /* name we display in the title */
   if (G_UNLIKELY (show_full_path && mousepad_document_get_filename (document)))
@@ -1474,7 +1462,7 @@ mousepad_window_notebook_added (GtkNotebook     *notebook,
   npages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->notebook));
 
   /* check tabs should always be visible */
-  g_object_get (G_OBJECT (window->preferences), "misc-always-show-tabs", &always_show_tabs, NULL);
+  always_show_tabs = g_settings_get_boolean (MOUSEPAD_GSETTINGS, "misc-always-show-tabs");
 
   /* change the visibility of the tabs accordingly */
   gtk_notebook_set_show_tabs (GTK_NOTEBOOK (window->notebook), always_show_tabs || (npages > 1));
@@ -1526,7 +1514,7 @@ mousepad_window_notebook_removed (GtkNotebook     *notebook,
   else
     {
       /* check tabs should always be visible */
-      g_object_get (G_OBJECT (window->preferences), "misc-always-show-tabs", &always_show_tabs, NULL);
+      always_show_tabs = g_settings_get_boolean (MOUSEPAD_GSETTINGS, "misc-always-show-tabs");
 
       /* change the visibility of the tabs accordingly */
       gtk_notebook_set_show_tabs (GTK_NOTEBOOK (window->notebook), always_show_tabs || (npages > 1));
@@ -2038,7 +2026,7 @@ mousepad_window_menu_tab_sizes (MousepadWindow *window)
   lock_menu_updates++;
 
   /* get the default tab sizes and active tab size */
-  g_object_get (G_OBJECT (window->preferences), "misc-default-tab-sizes", &tmp, NULL);
+  tmp = g_settings_get_string (MOUSEPAD_GSETTINGS, "misc-default-tab-sizes");
 
   /* get sizes array and free the temp string */
   tab_sizes = g_strsplit (tmp, ",", -1);
@@ -2221,7 +2209,7 @@ mousepad_window_update_actions (MousepadWindow *window)
       page_num = gtk_notebook_page_num (notebook, GTK_WIDGET (document));
 
       /* whether we cycle tabs */
-      g_object_get (G_OBJECT (window->preferences), "misc-cycle-tabs", &cycle_tabs, NULL);
+      cycle_tabs = g_settings_get_boolean (MOUSEPAD_GSETTINGS, "misc-cycle-tabs");
 
       /* set the sensitivity of the back and forward buttons in the go menu */
       action = gtk_action_group_get_action (window->action_group, "back");
@@ -2551,7 +2539,7 @@ mousepad_window_recent_menu_idle (gpointer user_data)
     }
 
   /* get the recent menu limit number */
-  g_object_get (G_OBJECT (window->preferences), "misc-recent-menu-items", &n, NULL);
+  n = g_settings_get_int (MOUSEPAD_GSETTINGS, "misc-recent-menu-items");
 
   /* append the items to the menu */
   for (li = filtered, i = 1; n > 0 && li != NULL; li = li->next)
@@ -3205,7 +3193,7 @@ mousepad_window_menu_color_schemes (MousepadWindow *window)
   lock_menu_updates++;
 
   /* get the previously saved colour scheme name */
-  g_object_get (window->preferences, "view-color-scheme", &selected_color_scheme, NULL);
+  selected_color_scheme = g_settings_get_string (MOUSEPAD_GSETTINGS, "view-color-scheme");
 
   /* get list of schemes */
   schemes = mousepad_util_color_schemes_get_sorted ();
@@ -3270,6 +3258,8 @@ mousepad_window_menu_color_schemes (MousepadWindow *window)
       g_free (name);
     }
 
+  g_free (selected_color_scheme);
+
   /* cleanup the list */
   g_slist_free (schemes);
 
@@ -4422,7 +4412,7 @@ mousepad_window_action_select_font (GtkAction      *action,
   gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (window));
 
   /* set the current font name */
-  g_object_get (G_OBJECT (window->preferences), "view-font-name", &font_name, NULL);
+  font_name = g_settings_get_string (MOUSEPAD_GSETTINGS, "view-font-name");
   if (G_LIKELY (font_name))
     {
       gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG (dialog), font_name);
@@ -4436,7 +4426,7 @@ mousepad_window_action_select_font (GtkAction      *action,
       font_name = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG (dialog));
 
       /* store the font in the preferences */
-      g_object_set (G_OBJECT (window->preferences), "view-font-name", font_name, NULL);
+      g_settings_set_string (MOUSEPAD_GSETTINGS, "view-font-name", font_name);
 
       /* apply the font in all documents in this window */
       for (i = 0; i < gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->notebook)); i++)
@@ -4502,10 +4492,11 @@ mousepad_window_action_color_scheme (GtkToggleAction *action,
         }
 
       /* store as last used value */
-      g_object_set (G_OBJECT (window->preferences),
-                    "view-color-scheme",
-                    (scheme != NULL) ? gtk_source_style_scheme_get_id (scheme) : "none",
-                    NULL);
+      g_settings_set_string (MOUSEPAD_GSETTINGS, "view-color-scheme",
+                             (scheme != NULL) ?
+                               gtk_source_style_scheme_get_id (scheme) :
+                               "none");
+        
 
       /* apply colour scheme to all open textviews */
       while ((page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (window->notebook), page_num)))
@@ -4543,7 +4534,7 @@ mousepad_window_action_line_numbers (GtkToggleAction *action,
       active = gtk_toggle_action_get_active (action);
 
       /* save as the last used line number setting */
-      g_object_set (G_OBJECT (window->preferences), "view-line-numbers", active, NULL);
+      g_settings_set_boolean (MOUSEPAD_GSETTINGS, "view-line-numbers", active);
 
       /* apply line numbers setting to all open textviews */
       while ((page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (window->notebook), page_num)))
@@ -4618,7 +4609,7 @@ mousepad_window_action_statusbar (GtkToggleAction *action,
     }
 
   /* remember the setting */
-  g_object_set (G_OBJECT (window->preferences), "window-statusbar-visible", show_statusbar, NULL);
+  g_settings_set_boolean (MOUSEPAD_GSETTINGS, "window-statusbar-visible", show_statusbar);
 }
 
 
@@ -4808,7 +4799,7 @@ mousepad_window_action_auto_indent (GtkToggleAction *action,
       active = gtk_toggle_action_get_active (action);
 
       /* save as the last auto indent mode */
-      g_object_set (G_OBJECT (window->preferences), "view-auto-indent", active, NULL);
+      g_settings_set_boolean (MOUSEPAD_GSETTINGS, "view-auto-indent", active);
 
       /* update the active document */
       mousepad_view_set_auto_indent (window->active->textview, active);
@@ -4872,7 +4863,7 @@ mousepad_window_action_tab_size (GtkToggleAction *action,
         }
 
       /* store as last used value */
-      g_object_set (G_OBJECT (window->preferences), "view-tab-size", tab_size, NULL);
+      g_settings_set_int (MOUSEPAD_GSETTINGS, "view-tab-size", tab_size);
 
       /* set the value */
       mousepad_view_set_tab_size (window->active->textview, tab_size);
@@ -4900,7 +4891,7 @@ mousepad_window_action_word_wrap (GtkToggleAction *action,
       active = gtk_toggle_action_get_active (action);
 
       /* store this as the last used wrap mode */
-      g_object_set (G_OBJECT (window->preferences), "view-word-wrap", active, NULL);
+      g_settings_set_boolean (MOUSEPAD_GSETTINGS, "view-word-wrap", active);
 
       /* set the wrapping mode of the current document */
       mousepad_document_set_word_wrap (window->active, active);
@@ -4986,7 +4977,7 @@ mousepad_window_action_insert_spaces (GtkToggleAction *action,
       insert_spaces = gtk_toggle_action_get_active (action);
 
       /* save as the last auto indent mode */
-      g_object_set (G_OBJECT (window->preferences), "view-insert-spaces", insert_spaces, NULL);
+      g_settings_set_boolean (MOUSEPAD_GSETTINGS, "view-insert-spaces", insert_spaces);
 
       /* update the active document */
       mousepad_view_set_insert_spaces (window->active->textview, insert_spaces);
diff --git a/mousepad/org.xfce.Mousepad.gschema.xml b/mousepad/org.xfce.Mousepad.gschema.xml
index ca60429..4b9adf9 100644
--- a/mousepad/org.xfce.Mousepad.gschema.xml
+++ b/mousepad/org.xfce.Mousepad.gschema.xml
@@ -45,7 +45,7 @@
 
     <!-- Textview preferences -->
 
-    <key name="view-autoindent" type="b">
+    <key name="view-auto-indent" type="b">
       <default>false</default>
       <summary>Auto-indentation</summary>
       <description>
@@ -62,7 +62,7 @@
       </description>
     </key>
 
-    <key name="view-show-line-numbers" type="b">
+    <key name="view-line-numbers" type="b">
       <default>false</default>
       <summary>Show line numbers</summary>
       <description>

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list