[gnome-commander/GSettings] Adds show_fifo filter option to GSettings migration (now known as hide-fifo)



commit 24050454a795abc733cdc4a21ff0be7eb9d9bf5b
Author: Uwe Scholz <uwescholz src gnome org>
Date:   Tue May 17 20:40:29 2016 +0200

    Adds show_fifo filter option to GSettings migration (now known as hide-fifo)

 data/org.gnome.gnome-commander.gschema.xml |    2 +-
 src/gnome-cmd-data.cc                      |   15 +++++++++++++--
 src/gnome-cmd-data.h                       |    1 +
 3 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/data/org.gnome.gnome-commander.gschema.xml b/data/org.gnome.gnome-commander.gschema.xml
index 8214d3a..cf649f2 100644
--- a/data/org.gnome.gnome-commander.gschema.xml
+++ b/data/org.gnome.gnome-commander.gschema.xml
@@ -324,7 +324,7 @@
     </key>
     <key name="hide-fifo" type="b">
       <default>false</default>
-      <summary></summary>
+      <summary>Hide FIFO pipes</summary>
     </key>
     <key name="hide-socket" type="b">
       <default>false</default>
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index cad02de..6757e9c 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -141,6 +141,9 @@ void on_filter_changed ()
     filter = g_settings_get_boolean (gnome_cmd_data.options.gcmd_settings->filter, 
GCMD_SETTINGS_FILTER_HIDE_DIRECTORY);
     gnome_cmd_data.options.filter.file_types[GNOME_VFS_FILE_TYPE_DIRECTORY] = filter;
 
+    filter = g_settings_get_boolean (gnome_cmd_data.options.gcmd_settings->filter, 
GCMD_SETTINGS_FILTER_HIDE_FIFO);
+    gnome_cmd_data.options.filter.file_types[GNOME_VFS_FILE_TYPE_FIFO] = filter;
+
     main_win->update_view();
 }
 
@@ -200,6 +203,11 @@ static void gcmd_connect_gsettings_signals(GcmdSettings *gs)
                       G_CALLBACK (on_filter_changed),
                       NULL);
 
+    g_signal_connect (gs->filter,
+                      "changed::hide-fifo",
+                      G_CALLBACK (on_filter_changed),
+                      NULL);
+
 }
 
 
@@ -1556,6 +1564,9 @@ void GnomeCmdData::migrate_all_data_to_gsettings()
         //show_directory
         migrate_data_int_value_into_gsettings(gnome_cmd_data_get_bool ("/options/show_directory", FALSE) ? 1 
: 0,
                                                         options.gcmd_settings->filter, 
GCMD_SETTINGS_FILTER_HIDE_DIRECTORY);
+        //show_fifo
+        migrate_data_int_value_into_gsettings(gnome_cmd_data_get_bool ("/options/show_fifo", FALSE) ? 1 : 0,
+                                                        options.gcmd_settings->filter, 
GCMD_SETTINGS_FILTER_HIDE_FIFO);
         // 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
@@ -1676,7 +1687,7 @@ void GnomeCmdData::load()
     options.filter.file_types[GNOME_VFS_FILE_TYPE_UNKNOWN] = g_settings_get_boolean 
(options.gcmd_settings->filter, GCMD_SETTINGS_FILTER_HIDE_UNKNOWN);
     options.filter.file_types[GNOME_VFS_FILE_TYPE_REGULAR] = g_settings_get_boolean 
(options.gcmd_settings->filter, GCMD_SETTINGS_FILTER_HIDE_REGULAR);
     options.filter.file_types[GNOME_VFS_FILE_TYPE_DIRECTORY] = g_settings_get_boolean 
(options.gcmd_settings->filter, GCMD_SETTINGS_FILTER_HIDE_DIRECTORY);
-    options.filter.file_types[GNOME_VFS_FILE_TYPE_FIFO] = gnome_cmd_data_get_bool ("/options/show_fifo", 
FALSE);
+    options.filter.file_types[GNOME_VFS_FILE_TYPE_FIFO] = g_settings_get_boolean 
(options.gcmd_settings->filter, GCMD_SETTINGS_FILTER_HIDE_FIFO);
     options.filter.file_types[GNOME_VFS_FILE_TYPE_SOCKET] = gnome_cmd_data_get_bool ("/options/show_socket", 
FALSE);
     options.filter.file_types[GNOME_VFS_FILE_TYPE_CHARACTER_DEVICE] = gnome_cmd_data_get_bool 
("/options/show_char_device", FALSE);
     options.filter.file_types[GNOME_VFS_FILE_TYPE_BLOCK_DEVICE] = gnome_cmd_data_get_bool 
("/options/show_block_device", FALSE);
@@ -2221,7 +2232,7 @@ void GnomeCmdData::save()
     set_gsettings_when_changed      (options.gcmd_settings->filter, GCMD_SETTINGS_FILTER_HIDE_UNKNOWN, 
&(options.filter.file_types[GNOME_VFS_FILE_TYPE_UNKNOWN]));
     set_gsettings_when_changed      (options.gcmd_settings->filter, GCMD_SETTINGS_FILTER_HIDE_REGULAR, 
&(options.filter.file_types[GNOME_VFS_FILE_TYPE_REGULAR]));
     set_gsettings_when_changed      (options.gcmd_settings->filter, GCMD_SETTINGS_FILTER_HIDE_DIRECTORY, 
&(options.filter.file_types[GNOME_VFS_FILE_TYPE_DIRECTORY]));
-    gnome_cmd_data_set_bool   ("/options/show_fifo", options.filter.file_types[GNOME_VFS_FILE_TYPE_FIFO]);
+    set_gsettings_when_changed      (options.gcmd_settings->filter, GCMD_SETTINGS_FILTER_HIDE_FIFO, 
&(options.filter.file_types[GNOME_VFS_FILE_TYPE_FIFO]));
     gnome_cmd_data_set_bool   ("/options/show_socket", 
options.filter.file_types[GNOME_VFS_FILE_TYPE_SOCKET]);
     gnome_cmd_data_set_bool   ("/options/show_char_device", 
options.filter.file_types[GNOME_VFS_FILE_TYPE_CHARACTER_DEVICE]);
     gnome_cmd_data_set_bool   ("/options/show_block_device", 
options.filter.file_types[GNOME_VFS_FILE_TYPE_BLOCK_DEVICE]);
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index 85b8ca2..59906e4 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -67,6 +67,7 @@ GcmdSettings *gcmd_settings_new (void);
 #define GCMD_SETTINGS_FILTER_HIDE_UNKNOWN             "hide-unknown"
 #define GCMD_SETTINGS_FILTER_HIDE_REGULAR             "hide-regular"
 #define GCMD_SETTINGS_FILTER_HIDE_DIRECTORY           "hide-directory"
+#define GCMD_SETTINGS_FILTER_HIDE_FIFO                "hide-fifo"
 
 struct GnomeCmdConRemote;
 


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