[gnome-commander/GSettings] Adds dev_icon_size option to GSettings (now known as dev-icon-size)



commit a57e7d0541f33a56cbcda17a096d92dc17d92a62
Author: Uwe Scholz <uwescholz src gnome org>
Date:   Sun May 22 15:35:03 2016 +0200

    Adds dev_icon_size option to GSettings (now known as dev-icon-size)

 data/org.gnome.gnome-commander.gschema.xml |    8 ++++----
 src/gnome-cmd-data.cc                      |    8 ++++++--
 src/gnome-cmd-data.h                       |    1 +
 3 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/data/org.gnome.gnome-commander.gschema.xml b/data/org.gnome.gnome-commander.gschema.xml
index 2bd8d42..4effdbf 100644
--- a/data/org.gnome.gnome-commander.gschema.xml
+++ b/data/org.gnome.gnome-commander.gschema.xml
@@ -146,10 +146,10 @@
       <summary>Icon size</summary>
       <description>Size of icons in the file pane.</description>
     </key>
-    <key name="dev-icon-size" type="i">
-      <default l10n="messages">16</default>
-      <summary></summary>
-      <description></description>
+    <key name="dev-icon-size" type="u">
+      <default>16</default>
+      <summary>Device icon size</summary>
+      <description>Icon size in the device list.</description>
     </key>
     <key name="icon-scale-quality" type="i">
       <default l10n="messages">3</default>
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 894ba7a..6bb2f80 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -1557,6 +1557,7 @@ GnomeCmdData::GnomeCmdData(): search_defaults(selections)
     cmdline_visibility = TRUE;
     buttonbar_visibility = TRUE;
 
+    //TODO: Include into GnomeCmdData::Options
     dev_icon_size = 16;
     memset(fs_col_width, 0, sizeof(fs_col_width));
     gui_update_rate = DEFAULT_GUI_UPDATE_RATE;
@@ -1696,6 +1697,9 @@ void GnomeCmdData::migrate_all_data_to_gsettings()
         //icon_size
         migrate_data_int_value_into_gsettings(gnome_cmd_data_get_int ("/options/icon_size", 16),
                                                         options.gcmd_settings->general, 
GCMD_SETTINGS_ICON_SIZE);
+        //dev-icon_size
+        migrate_data_int_value_into_gsettings(gnome_cmd_data_get_int ("/options/dev_icon_size", 16),
+                                                        options.gcmd_settings->general, 
GCMD_SETTINGS_DEV_ICON_SIZE);
         // ToDo: Move old xml-file to ~/.gnome-commander/gnome-commander.xml.backup
         //       à la save_devices_old ("devices.backup");
         //       and move .gnome2/gnome-commander to .gnome2/gnome-commander.backup
@@ -1876,7 +1880,7 @@ void GnomeCmdData::load()
     options.middle_mouse_button_mode = (MiddleMouseButtonMode) gnome_cmd_data_get_int 
("/options/middle_mouse_button_mode", MIDDLE_BUTTON_GOES_UP_DIR);
     options.right_mouse_button_mode = (RightMouseButtonMode) g_settings_get_enum 
(options.gcmd_settings->general, GCMD_SETTINGS_RIGHT_MOUSE_BUTTON_MODE);
     options.icon_size = g_settings_get_uint (options.gcmd_settings->general, GCMD_SETTINGS_ICON_SIZE);
-    dev_icon_size = gnome_cmd_data_get_int ("/options/dev_icon_size", 16);
+    dev_icon_size = g_settings_get_uint (options.gcmd_settings->general, GCMD_SETTINGS_DEV_ICON_SIZE);
     options.icon_scale_quality = (GdkInterpType) gnome_cmd_data_get_int ("/options/icon_scale_quality", 
GDK_INTERP_HYPER);
     options.theme_icon_dir = gnome_cmd_data_get_string ("/options/theme_icon_dir", theme_icon_dir);
     g_free (theme_icon_dir);
@@ -2410,7 +2414,7 @@ void GnomeCmdData::save()
     gnome_cmd_data_set_int    ("/options/middle_mouse_button_mode", options.middle_mouse_button_mode);
     set_gsettings_enum_when_changed (options.gcmd_settings->general, GCMD_SETTINGS_RIGHT_MOUSE_BUTTON_MODE, 
options.right_mouse_button_mode);
     set_gsettings_when_changed      (options.gcmd_settings->general, GCMD_SETTINGS_ICON_SIZE, 
&(options.icon_size));
-    gnome_cmd_data_set_int    ("/options/dev_icon_size", dev_icon_size);
+    set_gsettings_when_changed      (options.gcmd_settings->general, GCMD_SETTINGS_DEV_ICON_SIZE, 
&(dev_icon_size));
     gnome_cmd_data_set_int    ("/options/icon_scale_quality", options.icon_scale_quality);
     gnome_cmd_data_set_string ("/options/theme_icon_dir", options.theme_icon_dir);
     gnome_cmd_data_set_string ("/options/document_icon_dir", options.document_icon_dir);
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index b77fe71..7ee4b9c 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -68,6 +68,7 @@ GcmdSettings *gcmd_settings_new (void);
 #define GCMD_SETTINGS_LEFT_MOUSE_BUTTON_UNSELECTS     "left-mouse-btn-unselects"
 #define GCMD_SETTINGS_RIGHT_MOUSE_BUTTON_MODE         "right-mouse-btn-mode"
 #define GCMD_SETTINGS_ICON_SIZE                       "icon-size"
+#define GCMD_SETTINGS_DEV_ICON_SIZE                   "dev-icon-size"
 
 #define GCMD_PREF_FILTER                              "org.gnome.gnome-commander.preferences.filter"
 #define GCMD_SETTINGS_FILTER_HIDE_UNKNOWN             "hide-unknown"


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