[gnome-commander/GSettings] Adds case_sens to GSettings (now known as case-sensitive-search)
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/GSettings] Adds case_sens to GSettings (now known as case-sensitive-search)
- Date: Sun, 17 Jul 2016 18:06:30 +0000 (UTC)
commit 5e5f0e16c51af9fe12ceb163c9667d9002681676
Author: Uwe Scholz <uwescholz src gnome org>
Date: Sun Jul 17 19:04:48 2016 +0200
Adds case_sens to GSettings (now known as case-sensitive-search)
data/org.gnome.gnome-commander.gschema.xml | 8 +++++---
src/gnome-cmd-data.cc | 24 +++++++++++++++---------
src/gnome-cmd-data.h | 3 +++
3 files changed, 23 insertions(+), 12 deletions(-)
---
diff --git a/data/org.gnome.gnome-commander.gschema.xml b/data/org.gnome.gnome-commander.gschema.xml
index 5c034ab..6694df0 100644
--- a/data/org.gnome.gnome-commander.gschema.xml
+++ b/data/org.gnome.gnome-commander.gschema.xml
@@ -977,10 +977,12 @@
</key>
</schema>
<schema gettext-domain="gnome-commander" id="org.gnome.gnome-commander.preferences.internal-viewer"
path="/org/gnome/gnome-commander/preferences/internal-viewer/">
- <key name="case-sens" type="b">
+ <key name="case-sensitive-search" type="b">
<default l10n="messages">false</default>
- <summary></summary>
- <description></description>
+ <summary>Case sensitive search</summary>
+ <description>
+ This option defines if searching within the internal viewer is case sensitive.
+ </description>
</key>
<key name="last-mode" type="i">
<default l10n="messages">0</default>
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 575d453..43ddded 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -71,6 +71,7 @@ struct _GcmdSettings
GSettings *programs;
GSettings *keybindings;
GSettings *network;
+ GSettings *internalviewer;
};
G_DEFINE_TYPE (GcmdSettings, gcmd_settings, G_TYPE_OBJECT)
@@ -95,6 +96,7 @@ static void gcmd_settings_dispose (GObject *object)
g_clear_object (&gs->programs);
g_clear_object (&gs->keybindings);
g_clear_object (&gs->network);
+ g_clear_object (&gs->internalviewer);
G_OBJECT_CLASS (gcmd_settings_parent_class)->dispose (object);
}
@@ -1262,13 +1264,14 @@ static void gcmd_connect_gsettings_signals(GcmdSettings *gs)
static void gcmd_settings_init (GcmdSettings *gs)
{
- gs->general = g_settings_new (GCMD_PREF_GENERAL);
- gs->filter = g_settings_new (GCMD_PREF_FILTER);
- gs->confirm = g_settings_new (GCMD_PREF_CONFIRM);
- gs->colors = g_settings_new (GCMD_PREF_COLORS);
- gs->programs = g_settings_new (GCMD_PREF_PROGRAMS);
- gs->keybindings = g_settings_new (GCMD_PREF_KEYBINDINGS);
- gs->network = g_settings_new (GCMD_PREF_NETWORK);
+ gs->general = g_settings_new (GCMD_PREF_GENERAL);
+ gs->filter = g_settings_new (GCMD_PREF_FILTER);
+ gs->confirm = g_settings_new (GCMD_PREF_CONFIRM);
+ gs->colors = g_settings_new (GCMD_PREF_COLORS);
+ gs->programs = g_settings_new (GCMD_PREF_PROGRAMS);
+ gs->keybindings = g_settings_new (GCMD_PREF_KEYBINDINGS);
+ gs->network = g_settings_new (GCMD_PREF_NETWORK);
+ gs->internalviewer = g_settings_new (GCMD_PREF_INTERNAL_VIEWER);
//TODO: Activate the following function in GCMD > 1.6
//gcmd_connect_gsettings_signals(gs);
}
@@ -2388,7 +2391,7 @@ inline void GnomeCmdData::save_intviewer_defaults()
{
gnome_cmd_data_set_string_history ("/internal_viewer/text_pattern%d",
intviewer_defaults.text_patterns.ents);
gnome_cmd_data_set_string_history ("/internal_viewer/hex_pattern%d",
intviewer_defaults.hex_patterns.ents);
- gnome_cmd_data_set_bool ("/internal_viewer/case_sens", intviewer_defaults.case_sensitive);
+ set_gsettings_when_changed (options.gcmd_settings->internalviewer, GCMD_SETTINGS_IV_CASE_SENSITIVE,
&(intviewer_defaults.case_sensitive));
gnome_cmd_data_set_int ("/internal_viewer/last_mode", intviewer_defaults.search_mode);
}
@@ -2439,7 +2442,7 @@ inline void GnomeCmdData::load_intviewer_defaults()
{
intviewer_defaults.text_patterns = load_string_history ("/internal_viewer/text_pattern%d", -1);
intviewer_defaults.hex_patterns.ents = load_string_history ("/internal_viewer/hex_pattern%d", -1);
- intviewer_defaults.case_sensitive = gnome_cmd_data_get_bool ("/internal_viewer/case_sens", FALSE);
+ intviewer_defaults.case_sensitive = g_settings_get_boolean (options.gcmd_settings->internalviewer,
GCMD_SETTINGS_IV_CASE_SENSITIVE);
intviewer_defaults.search_mode = gnome_cmd_data_get_int ("/internal_viewer/last_mode", 0);
}
@@ -2919,6 +2922,9 @@ void GnomeCmdData::migrate_all_data_to_gsettings()
//ftp_anonymous_password
migrate_data_string_value_into_gsettings(gnome_cmd_data_get_string
("/network/ftp_anonymous_password", "you provider com"),
options.gcmd_settings->network,
GCMD_SETTINGS_FTP_ANONYMOUS_PASSWORD);
+ //case_sens
+ migrate_data_int_value_into_gsettings(gnome_cmd_data_get_bool ("/internal_viewer/case_sens", FALSE)
? 1 : 0,
+ options.gcmd_settings->internalviewer,
GCMD_SETTINGS_IV_CASE_SENSITIVE);
g_free(color);
// ToDo: Move old xml-file to ~/.gnome-commander/gnome-commander.xml.backup
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index e60a1c3..3a021a9 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -164,6 +164,9 @@ GcmdSettings *gcmd_settings_new (void);
#define GCMD_SETTINGS_QUICK_CONNECT_URI "quick-connect-uri"
#define GCMD_SETTINGS_FTP_ANONYMOUS_PASSWORD "ftp-anonymous-password"
+#define GCMD_PREF_INTERNAL_VIEWER "org.gnome.gnome-commander.preferences.internal-viewer"
+#define GCMD_SETTINGS_IV_CASE_SENSITIVE "case-sensitive-search"
+
struct GnomeCmdConRemote;
struct GnomeCmdData
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]