[gnome-commander] GnomeCmdData: store shell/syntax matching type in gnome_cmd_data.search_defaults.default_profile.syn



commit 8c3424a5e07bfd422c2aeb68579f973a1993eb01
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Sat May 7 22:38:11 2011 +0200

    GnomeCmdData: store shell/syntax matching type in gnome_cmd_data.search_defaults.default_profile.syntax (instead of previous gnome_cmd_data.filter_type)

 doc/C/gnome-commander.xml          |    7 -------
 src/gnome-cmd-data.cc              |    3 ---
 src/gnome-cmd-data.h               |    1 -
 src/gnome-cmd-patternsel-dialog.cc |    8 ++++----
 src/gnome-cmd-search-dialog.cc     |    4 ++--
 5 files changed, 6 insertions(+), 17 deletions(-)
---
diff --git a/doc/C/gnome-commander.xml b/doc/C/gnome-commander.xml
index fc545b5..1f9e459 100644
--- a/doc/C/gnome-commander.xml
+++ b/doc/C/gnome-commander.xml
@@ -7100,13 +7100,6 @@
                                 </row>
                                 <row valign="top">
                                     <entry><para></para></entry>
-                                    <entry><para>filter_type</para></entry>
-                                    <entry><para></para></entry>
-                                    <entry><para></para></entry>
-                                    <entry><para></para></entry>
-                                </row>
-                                <row valign="top">
-                                    <entry><para></para></entry>
                                     <entry><para>hidden_filter</para></entry>
                                     <entry><para></para></entry>
                                     <entry><para></para></entry>
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index da78be0..dfc692a 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -907,7 +907,6 @@ GnomeCmdData::GnomeCmdData()
     quick_search_exact_match_begin = TRUE;
     quick_search_exact_match_end = FALSE;
 
-    filter_type = Filter::TYPE_FNMATCH;
     memset(&filter_settings, 0, sizeof(filter_settings));
     filter_settings.hidden = TRUE;
     filter_settings.backup = TRUE;
@@ -1164,7 +1163,6 @@ void GnomeCmdData::load()
     g_free (document_icon_dir);
     cmdline_history_length = gnome_cmd_data_get_int ("/options/cmdline_history_length", 16);
     button_relief = (GtkReliefStyle) gnome_cmd_data_get_int ("/options/btn_relief", GTK_RELIEF_NONE);
-    filter_type = (Filter::Type) gnome_cmd_data_get_int ("/options/filter_type", Filter::TYPE_FNMATCH);
     list_orientation = gnome_cmd_data_get_bool ("/options/list_orientation", FALSE);
     gui_update_rate = gnome_cmd_data_get_int ("/options/gui_update_rate", DEFAULT_GUI_UPDATE_RATE);
     priv->main_win_pos[0] = gnome_cmd_data_get_int ("/options/main_win_pos_x", -1);
@@ -1586,7 +1584,6 @@ void GnomeCmdData::save()
     gnome_cmd_data_set_string ("/options/document_icon_dir", priv->document_icon_dir);
     gnome_cmd_data_set_int    ("/options/cmdline_history_length", cmdline_history_length);
     gnome_cmd_data_set_int    ("/options/btn_relief", button_relief);
-    gnome_cmd_data_set_int    ("/options/filter_type", filter_type);
     gnome_cmd_data_set_bool   ("/options/list_orientation", list_orientation);
     gnome_cmd_data_set_int    ("/options/gui_update_rate", gui_update_rate);
 
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index 05fe4ef..5059477 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -205,7 +205,6 @@ struct GnomeCmdData
     gboolean                     quick_search_exact_match_begin;
     gboolean                     quick_search_exact_match_end;
 
-    Filter::Type                 filter_type;
     FilterSettings               filter_settings;
 
     std::vector<Selection>       selections;
diff --git a/src/gnome-cmd-patternsel-dialog.cc b/src/gnome-cmd-patternsel-dialog.cc
index b166646..6664d09 100644
--- a/src/gnome-cmd-patternsel-dialog.cc
+++ b/src/gnome-cmd-patternsel-dialog.cc
@@ -49,11 +49,11 @@ static void on_ok (GtkButton *button, GnomeCmdPatternselDialog *dialog)
     g_return_if_fail (GNOME_CMD_IS_PATTERNSEL_DIALOG (dialog));
 
     gboolean case_sens = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->case_check));
-    gnome_cmd_data.filter_type = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (lookup_widget (GTK_WIDGET (dialog), "regex_radio"))) ? Filter::TYPE_REGEX : Filter::TYPE_FNMATCH;
+    gnome_cmd_data.search_defaults.default_profile.syntax = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (lookup_widget (GTK_WIDGET (dialog), "regex_radio"))) ? Filter::TYPE_REGEX : Filter::TYPE_FNMATCH;
 
     const gchar *s = gtk_entry_get_text (GTK_ENTRY (dialog->priv->pattern_entry));
 
-    Filter pattern(s, case_sens, gnome_cmd_data.filter_type);
+    Filter pattern(s, case_sens, gnome_cmd_data.search_defaults.default_profile.syntax);
     
     if (dialog->priv->mode)
         dialog->priv->fl->select(pattern);
@@ -121,11 +121,11 @@ static void gnome_cmd_patternsel_dialog_init (GnomeCmdPatternselDialog *dialog)
 
     radio = create_radio_with_mnemonic (GTK_WIDGET (dialog), NULL, _("She_ll syntax"), "shell_radio");
     gtk_box_pack_end (GTK_BOX (hbox), radio, TRUE, FALSE, 0);
-    if (gnome_cmd_data.filter_type == Filter::TYPE_FNMATCH)
+    if (gnome_cmd_data.search_defaults.default_profile.syntax == Filter::TYPE_FNMATCH)
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), TRUE);
     radio = create_radio_with_mnemonic (GTK_WIDGET (dialog), get_radio_group (radio), _("Rege_x syntax"), "regex_radio");
     gtk_box_pack_end (GTK_BOX (hbox), radio, TRUE, FALSE, 0);
-    if (gnome_cmd_data.filter_type == Filter::TYPE_REGEX)
+    if (gnome_cmd_data.search_defaults.default_profile.syntax == Filter::TYPE_REGEX)
         gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), TRUE);
 
     gnome_cmd_dialog_add_category (GNOME_CMD_DIALOG (dialog), vbox);
diff --git a/src/gnome-cmd-search-dialog.cc b/src/gnome-cmd-search-dialog.cc
index 12956bb..2aa7e58 100755
--- a/src/gnome-cmd-search-dialog.cc
+++ b/src/gnome-cmd-search-dialog.cc
@@ -469,7 +469,7 @@ static void on_dialog_destroy (GnomeCmdSearchDialog *dialog, gpointer user_data)
     gnome_cmd_data.search_defaults.width = allocation.width;
     gnome_cmd_data.search_defaults.height = allocation.height;
 
-    gnome_cmd_data.filter_type = (Filter::Type) gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->priv->filter_type_combo));
+    gnome_cmd_data.search_defaults.default_profile.syntax = (Filter::Type) gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->priv->filter_type_combo));
     gnome_cmd_data.search_defaults.default_profile.max_depth = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->priv->recurse_check)) ? -1 : 0;
 }
 
@@ -768,7 +768,7 @@ static void gnome_cmd_search_dialog_init (GnomeCmdSearchDialog *dialog)
     dialog->priv->filter_type_combo = gtk_combo_box_new_text ();
     gtk_combo_box_append_text (GTK_COMBO_BOX (dialog->priv->filter_type_combo), _("Name matches regex:"));
     gtk_combo_box_append_text (GTK_COMBO_BOX (dialog->priv->filter_type_combo), _("Name contains:"));
-    gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->filter_type_combo), (int) gnome_cmd_data.filter_type);
+    gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->priv->filter_type_combo), (int) gnome_cmd_data.search_defaults.default_profile.syntax);
     gtk_widget_show (dialog->priv->filter_type_combo);
     dialog->priv->pattern_combo = create_combo_box_entry (window);
     table_add (table, dialog->priv->filter_type_combo, 0, 0, GTK_FILL);



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