[gnome-commander] GnomeCmdData: more C++ rework
- From: Piotr Eljasiak <epiotr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] GnomeCmdData: more C++ rework
- Date: Fri, 11 Nov 2011 17:36:30 +0000 (UTC)
commit ccf25b81a87829970016e845a42bf15431387416
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Fri Nov 11 18:35:16 2011 +0100
GnomeCmdData: more C++ rework
src/gnome-cmd-data.cc | 22 ----------------------
src/gnome-cmd-data.h | 14 +++++++++-----
src/gnome-cmd-file-list.cc | 2 +-
src/gnome-cmd-options-dialog.cc | 4 ++--
4 files changed, 12 insertions(+), 30 deletions(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index ae93845..c67eebe 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -1741,28 +1741,6 @@ void gnome_cmd_data_get_main_win_pos (gint *x, gint *y)
}
-void gnome_cmd_data_set_backup_pattern (const gchar *value)
-{
- g_free (gnome_cmd_data.options.backup_pattern);
- patlist_free (gnome_cmd_data.options.backup_pattern_list);
-
- gnome_cmd_data.options.backup_pattern = g_strdup (value);
- gnome_cmd_data.options.backup_pattern_list = patlist_new (gnome_cmd_data.options.backup_pattern);
-}
-
-
-const gchar *gnome_cmd_data_get_backup_pattern ()
-{
- return gnome_cmd_data.options.backup_pattern;
-}
-
-
-GList *gnome_cmd_data_get_backup_pattern_list ()
-{
- return gnome_cmd_data.options.backup_pattern_list;
-}
-
-
const gchar *gnome_cmd_data_get_symlink_prefix ()
{
return gnome_cmd_data.priv->symlink_prefix ? gnome_cmd_data.priv->symlink_prefix : _("link to %s");
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index c2618bc..b3321ce 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -192,6 +192,15 @@ struct GnomeCmdData
g_free (document_icon_dir);
document_icon_dir = g_strdup (dir);
}
+
+ void set_backup_pattern(const gchar *value)
+ {
+ g_free (backup_pattern);
+ patlist_free (backup_pattern_list);
+
+ backup_pattern = g_strdup (value);
+ backup_pattern_list = patlist_new (backup_pattern);
+ }
};
struct Selection
@@ -424,11 +433,6 @@ void gnome_cmd_data_set_auto_load_plugins (GList *plugins);
void gnome_cmd_data_get_main_win_pos (gint *x, gint *y);
void gnome_cmd_data_set_main_win_pos (gint x, gint y);
-const gchar *gnome_cmd_data_get_backup_pattern ();
-void gnome_cmd_data_set_backup_pattern (const gchar *value);
-
-GList *gnome_cmd_data_get_backup_pattern_list ();
-
const gchar *gnome_cmd_data_get_symlink_prefix ();
void gnome_cmd_data_set_symlink_prefix (const gchar *value);
diff --git a/src/gnome-cmd-file-list.cc b/src/gnome-cmd-file-list.cc
index 9b929eb..7997197 100644
--- a/src/gnome-cmd-file-list.cc
+++ b/src/gnome-cmd-file-list.cc
@@ -2561,7 +2561,7 @@ gboolean GnomeCmdFileList::file_is_wanted(GnomeCmdFile *f)
return FALSE;
if (info->name[0] == '.' && gnome_cmd_data.options.filter.hidden)
return FALSE;
- if (gnome_cmd_data.options.filter.backup && patlist_matches (gnome_cmd_data_get_backup_pattern_list (), info->name))
+ if (gnome_cmd_data.options.filter.backup && patlist_matches (gnome_cmd_data.options.backup_pattern_list, info->name))
return FALSE;
return TRUE;
diff --git a/src/gnome-cmd-options-dialog.cc b/src/gnome-cmd-options-dialog.cc
index 0a0b606..901277c 100644
--- a/src/gnome-cmd-options-dialog.cc
+++ b/src/gnome-cmd-options-dialog.cc
@@ -1081,7 +1081,7 @@ inline GtkWidget *create_filter_tab (GtkWidget *parent, GnomeCmdData &cfg)
cat = create_category (parent, cat_box, _("Backup files"));
gtk_box_pack_start (GTK_BOX (vbox), cat, FALSE, FALSE, 0);
- entry = create_entry (parent, "backup_pattern_entry", gnome_cmd_data_get_backup_pattern ());
+ entry = create_entry (parent, "backup_pattern_entry", cfg.options.backup_pattern);
gtk_box_pack_start (GTK_BOX (cat_box), entry, TRUE, FALSE, 0);
gtk_widget_set_sensitive (entry, cfg.options.filter.backup);
@@ -1135,7 +1135,7 @@ inline void store_filter_options (GtkWidget *dialog, GnomeCmdData &cfg)
cfg.options.filter.backup =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (hide_backup_check));
- gnome_cmd_data_set_backup_pattern (gtk_entry_get_text (GTK_ENTRY (backup_pattern_entry)));
+ cfg.options.set_backup_pattern(gtk_entry_get_text (GTK_ENTRY (backup_pattern_entry)));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]