[gnome-commander] Always store the search history (this is used in the pattern selection and the multi rename tool)
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Always store the search history (this is used in the pattern selection and the multi rename tool)
- Date: Sat, 15 Jan 2022 23:07:08 +0000 (UTC)
commit b0171b989c483862d6997a6c7ce927efbe09a20d
Author: Uwe Scholz <u scholz83 gmx de>
Date: Sat Jan 15 23:47:33 2022 +0100
Always store the search history (this is used in the pattern selection and the multi rename tool)
data/org.gnome.gnome-commander.gschema.xml | 7 ------
src/dialogs/gnome-cmd-options-dialog.cc | 7 ------
src/gnome-cmd-data.cc | 39 +++++++-----------------------
src/gnome-cmd-data.h | 3 ---
4 files changed, 9 insertions(+), 47 deletions(-)
---
diff --git a/data/org.gnome.gnome-commander.gschema.xml b/data/org.gnome.gnome-commander.gschema.xml
index d7b5cbb3..7fe4aa80 100644
--- a/data/org.gnome.gnome-commander.gschema.xml
+++ b/data/org.gnome.gnome-commander.gschema.xml
@@ -416,13 +416,6 @@
Defines if the history of commands in the commandline is saved on exit.
</description>
</key>
- <key name="save-search-history-on-exit" type="b">
- <default>true</default>
- <summary>Save search history on exit</summary>
- <description>
- Defines if the history of search patterns is saved on exit.
- </description>
- </key>
<key name="always-show-tabs" type="b">
<default>false</default>
<summary>Always show tab bar</summary>
diff --git a/src/dialogs/gnome-cmd-options-dialog.cc b/src/dialogs/gnome-cmd-options-dialog.cc
index 585ee643..01736d33 100644
--- a/src/dialogs/gnome-cmd-options-dialog.cc
+++ b/src/dialogs/gnome-cmd-options-dialog.cc
@@ -247,11 +247,6 @@ static GtkWidget *create_general_tab (GtkWidget *parent, GnomeCmdData::Options &
gtk_box_pack_start (GTK_BOX (cat_box), check, FALSE, TRUE, 0);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), cfg.save_cmdline_history_on_exit);
- check = create_check (parent, _("Search history"), "save_search_history");
- gtk_box_pack_start (GTK_BOX (cat_box), check, FALSE, TRUE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), cfg.save_search_history_on_exit);
-
-
return frame;
}
@@ -276,7 +271,6 @@ void store_general_options (GtkWidget *dialog, GnomeCmdData::Options &cfg)
GtkWidget *save_tabs = lookup_widget (dialog, "save_tabs");
GtkWidget *save_dir_history = lookup_widget (dialog, "save_dir_history");
GtkWidget *save_cmdline_history = lookup_widget (dialog, "save_cmdline_history");
- GtkWidget *save_search_history = lookup_widget (dialog, "save_search_history");
cfg.left_mouse_button_mode = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (lmb_singleclick_radio)) ?
GnomeCmdData::LEFT_BUTTON_OPENS_WITH_SINGLE_CLICK : GnomeCmdData::LEFT_BUTTON_OPENS_WITH_DOUBLE_CLICK;
@@ -306,7 +300,6 @@ void store_general_options (GtkWidget *dialog, GnomeCmdData::Options &cfg)
cfg.save_tabs_on_exit = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (save_tabs));
cfg.save_dir_history_on_exit = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (save_dir_history));
cfg.save_cmdline_history_on_exit = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON
(save_cmdline_history));
- cfg.save_search_history_on_exit = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (save_search_history));
}
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 32779e8d..9138410f 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -1413,7 +1413,6 @@ GnomeCmdData::Options::Options(const Options &cfg)
save_tabs_on_exit = cfg.save_tabs_on_exit;
save_dir_history_on_exit = cfg.save_dir_history_on_exit;
save_cmdline_history_on_exit = cfg.save_cmdline_history_on_exit;
- save_search_history_on_exit = cfg.save_search_history_on_exit;
symlink_prefix = g_strdup (cfg.symlink_prefix);
main_win_pos[0] = cfg.main_win_pos[0];
main_win_pos[1] = cfg.main_win_pos[1];
@@ -1480,7 +1479,6 @@ GnomeCmdData::Options &GnomeCmdData::Options::operator = (const Options &cfg)
save_tabs_on_exit = cfg.save_tabs_on_exit;
save_dir_history_on_exit = cfg.save_dir_history_on_exit;
save_cmdline_history_on_exit = cfg.save_cmdline_history_on_exit;
- save_search_history_on_exit = cfg.save_search_history_on_exit;
symlink_prefix = g_strdup (cfg.symlink_prefix);
main_win_pos[0] = cfg.main_win_pos[0];
main_win_pos[1] = cfg.main_win_pos[1];
@@ -1648,13 +1646,7 @@ gboolean GnomeCmdData::add_bookmark_to_gvariant_builder(GVariantBuilder *gVarian
void GnomeCmdData::save_search_profiles ()
{
GVariantBuilder* gVariantBuilder = g_variant_builder_new(G_VARIANT_TYPE_ARRAY);
- if (options.save_search_history_on_exit)
- add_search_profile_to_gvariant_builder(gVariantBuilder, search_defaults.default_profile);
- else
- {
- SearchProfile searchProfile;
- add_search_profile_to_gvariant_builder(gVariantBuilder, searchProfile);
- }
+ add_search_profile_to_gvariant_builder(gVariantBuilder, search_defaults.default_profile);
for (auto profile : profiles)
{
@@ -2580,26 +2572,15 @@ void GnomeCmdData::save_directory_history()
void GnomeCmdData::save_search_history()
{
- if (gnome_cmd_data.options.save_search_history_on_exit)
- {
- set_gsettings_string_array_from_glist(
- options.gcmd_settings->general,
- GCMD_SETTINGS_SEARCH_PATTERN_HISTORY,
- search_defaults.name_patterns.ents);
+ set_gsettings_string_array_from_glist(
+ options.gcmd_settings->general,
+ GCMD_SETTINGS_SEARCH_PATTERN_HISTORY,
+ search_defaults.name_patterns.ents);
- set_gsettings_string_array_from_glist(
- options.gcmd_settings->general,
- GCMD_SETTINGS_SEARCH_TEXT_HISTORY,
- search_defaults.content_patterns.ents);
- }
- else
- {
- GVariant* searchHistoryToStore = g_settings_get_default_value (options.gcmd_settings->general,
GCMD_SETTINGS_SEARCH_PATTERN_HISTORY);
- g_settings_set_value(options.gcmd_settings->general, GCMD_SETTINGS_SEARCH_PATTERN_HISTORY,
searchHistoryToStore);
-
- searchHistoryToStore = g_settings_get_default_value (options.gcmd_settings->general,
GCMD_SETTINGS_SEARCH_TEXT_HISTORY);
- g_settings_set_value(options.gcmd_settings->general, GCMD_SETTINGS_SEARCH_TEXT_HISTORY,
searchHistoryToStore);
- }
+ set_gsettings_string_array_from_glist(
+ options.gcmd_settings->general,
+ GCMD_SETTINGS_SEARCH_TEXT_HISTORY,
+ search_defaults.content_patterns.ents);
}
@@ -3238,7 +3219,6 @@ void GnomeCmdData::load()
options.save_tabs_on_exit = g_settings_get_boolean (options.gcmd_settings->general,
GCMD_SETTINGS_SAVE_TABS_ON_EXIT);
options.save_dir_history_on_exit = g_settings_get_boolean (options.gcmd_settings->general,
GCMD_SETTINGS_SAVE_DIR_HISTORY_ON_EXIT);
options.save_cmdline_history_on_exit = g_settings_get_boolean (options.gcmd_settings->general,
GCMD_SETTINGS_SAVE_CMDLINE_HISTORY_ON_EXIT);
- options.save_search_history_on_exit = g_settings_get_boolean (options.gcmd_settings->general,
GCMD_SETTINGS_SAVE_SEARCH_HISTORY_ON_EXIT);
search_defaults.height = g_settings_get_uint(options.gcmd_settings->general,
GCMD_SETTINGS_SEARCH_WIN_HEIGHT);
search_defaults.width = g_settings_get_uint(options.gcmd_settings->general,
GCMD_SETTINGS_SEARCH_WIN_WIDTH);
search_defaults.content_patterns.ents = get_list_from_gsettings_string_array
(options.gcmd_settings->general, GCMD_SETTINGS_SEARCH_TEXT_HISTORY);
@@ -3638,7 +3618,6 @@ void GnomeCmdData::save()
set_gsettings_when_changed (options.gcmd_settings->general, GCMD_SETTINGS_SAVE_TABS_ON_EXIT,
&(options.save_tabs_on_exit));
set_gsettings_when_changed (options.gcmd_settings->general, GCMD_SETTINGS_SAVE_DIR_HISTORY_ON_EXIT,
&(options.save_dir_history_on_exit));
set_gsettings_when_changed (options.gcmd_settings->general,
GCMD_SETTINGS_SAVE_CMDLINE_HISTORY_ON_EXIT, &(options.save_cmdline_history_on_exit));
- set_gsettings_when_changed (options.gcmd_settings->general,
GCMD_SETTINGS_SAVE_SEARCH_HISTORY_ON_EXIT, &(options.save_search_history_on_exit));
set_gsettings_when_changed (options.gcmd_settings->general, GCMD_SETTINGS_SEARCH_WIN_WIDTH,
&(search_defaults.width));
set_gsettings_when_changed (options.gcmd_settings->general, GCMD_SETTINGS_SEARCH_WIN_HEIGHT,
&(search_defaults.height));
set_gsettings_when_changed (options.gcmd_settings->general, GCMD_SETTINGS_BOOKMARKS_WINDOW_WIDTH,
&(bookmarks_defaults.width));
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index 2ea2fb24..a2c0eb57 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -87,7 +87,6 @@ GcmdSettings *gcmd_settings_new (void);
#define GCMD_SETTINGS_SAVE_TABS_ON_EXIT "save-tabs-on-exit"
#define GCMD_SETTINGS_SAVE_DIR_HISTORY_ON_EXIT "save-dir-history-on-exit"
#define GCMD_SETTINGS_SAVE_CMDLINE_HISTORY_ON_EXIT "save-cmdline-history-on-exit"
-#define GCMD_SETTINGS_SAVE_SEARCH_HISTORY_ON_EXIT "save-search-history-on-exit"
#define GCMD_SETTINGS_ALWAYS_SHOW_TABS "always-show-tabs"
#define GCMD_SETTINGS_TAB_LOCK_INDICATOR "tab-lock-indicator"
#define GCMD_SETTINGS_MAIN_WIN_STATE "main-win-state"
@@ -330,7 +329,6 @@ struct GnomeCmdData
gboolean save_tabs_on_exit;
gboolean save_dir_history_on_exit;
gboolean save_cmdline_history_on_exit;
- gboolean save_search_history_on_exit;
gchar *symlink_prefix;
gint main_win_pos[2];
gboolean deleteToTrash;
@@ -394,7 +392,6 @@ struct GnomeCmdData
save_tabs_on_exit(TRUE),
save_dir_history_on_exit(TRUE),
save_cmdline_history_on_exit(TRUE),
- save_search_history_on_exit(TRUE),
symlink_prefix(nullptr),
main_win_pos{0,25},
deleteToTrash(TRUE),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]