[gnome-commander/GSettings] Moves get_bool and gnome_cmd_data_get_bool methods into GnomeCmdData class



commit 4035136f0b27e9454b1a6d3abc9417618fc70c98
Author: Uwe Scholz <uwescholz src gnome org>
Date:   Mon May 16 21:49:13 2016 +0200

    Moves get_bool and gnome_cmd_data_get_bool methods into GnomeCmdData class

 libgcmd/libgcmd-data.cc |   21 ---------------------
 libgcmd/libgcmd-data.h  |    2 --
 src/gnome-cmd-data.cc   |   21 +++++++++++++++++++++
 src/gnome-cmd-data.h    |    2 ++
 4 files changed, 23 insertions(+), 23 deletions(-)
---
diff --git a/libgcmd/libgcmd-data.cc b/libgcmd/libgcmd-data.cc
index 61e1591..5bb3d02 100644
--- a/libgcmd/libgcmd-data.cc
+++ b/libgcmd/libgcmd-data.cc
@@ -43,15 +43,6 @@ inline gchar *get_string (const gchar *path, const gchar *def)
     return value;
 }
 
-inline gboolean get_bool (const gchar *path, gboolean def)
-{
-    gboolean b = FALSE;
-    gboolean value = gnome_config_get_bool_with_default (path, &b);
-    if (b)
-        return def;
-    return value;
-}
-
 
 inline void set_color (const gchar *path, GdkColor *color)
 {
@@ -112,18 +103,6 @@ void gnome_cmd_data_set_color (const gchar *path, GdkColor *color)
 }
 
 
-gboolean gnome_cmd_data_get_bool (const gchar *path, gboolean def)
-{
-    gchar *s = g_build_path (G_DIR_SEPARATOR_S, PACKAGE, path, NULL);
-
-    gboolean v = get_bool (s, def);
-
-    g_free (s);
-
-    return v;
-}
-
-
 void gnome_cmd_data_get_color (const gchar *path, GdkColor *color)
 {
     gchar *s = g_build_path (G_DIR_SEPARATOR_S, PACKAGE, path, NULL);
diff --git a/libgcmd/libgcmd-data.h b/libgcmd/libgcmd-data.h
index fb3c695..b835323 100644
--- a/libgcmd/libgcmd-data.h
+++ b/libgcmd/libgcmd-data.h
@@ -28,8 +28,6 @@ void gnome_cmd_data_set_bool (const gchar *path, gboolean value);
 
 void gnome_cmd_data_set_color (const gchar *path, GdkColor *color);
 
-gboolean gnome_cmd_data_get_bool (const gchar *path, gboolean def);
-
 void gnome_cmd_data_get_color (const gchar *path, GdkColor *color);
 
 #endif //__LIBGCMD_DATA_H__
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 4e12750..c66e870 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -381,6 +381,16 @@ inline gchar* GnomeCmdData::get_string (const gchar *path, const gchar *def)
 }
 
 
+inline gboolean GnomeCmdData::get_bool (const gchar *path, gboolean def)
+{
+    gboolean b = FALSE;
+    gboolean value = gnome_config_get_bool_with_default (path, &b);
+    if (b)
+        return def;
+    return value;
+}
+
+
 inline XML::xstream &operator << (XML::xstream &xml, GnomeCmdBookmark &bookmark)
 {
     xml << XML::tag("Bookmark") << XML::attr("name") << XML::escape(bookmark.name);
@@ -2390,6 +2400,17 @@ gchar* GnomeCmdData::gnome_cmd_data_get_string (const gchar *path, const gchar *
     return v;
 }
 
+gboolean GnomeCmdData::gnome_cmd_data_get_bool (const gchar *path, gboolean def)
+{
+    gchar *s = g_build_path (G_DIR_SEPARATOR_S, PACKAGE, path, NULL);
+
+    gboolean v = get_bool (s, def);
+
+    g_free (s);
+
+    return v;
+}
+
 
 /**
  * As GSettings enum-type is of GVARIANT_CLASS String, we need a seperate function for
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index a796bdb..acec098 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -456,6 +456,7 @@ struct GnomeCmdData
     inline gint get_int (const gchar *path, int def);
     inline void set_int (const gchar *path, int value);
     inline gchar* get_string (const gchar *path, const gchar *def);
+    inline gboolean get_bool (const gchar *path, gboolean def);
 
   public:
 
@@ -512,6 +513,7 @@ struct GnomeCmdData
     gint gnome_cmd_data_get_int (const gchar *path, int def);
     void gnome_cmd_data_set_int (const gchar *path, int value);
     gchar* gnome_cmd_data_get_string (const gchar *path, const gchar *def);
+    gboolean gnome_cmd_data_get_bool (const gchar *path, gboolean def);
     gboolean set_gsettings_when_changed (GSettings *settings, const char *key, gpointer value);
     gboolean set_gsettings_enum_when_changed (GSettings *settings, const char *key, gint value);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]