gnome-commander r2324 - in trunk: . src
- From: epiotr svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-commander r2324 - in trunk: . src
- Date: Sat, 29 Nov 2008 14:54:53 +0000 (UTC)
Author: epiotr
Date: Sat Nov 29 14:54:53 2008
New Revision: 2324
URL: http://svn.gnome.org/viewvc/gnome-commander?rev=2324&view=rev
Log:
Added AdvrenameConfig::fill_regex_model(Profile &)
Modified:
trunk/ChangeLog
trunk/src/gnome-cmd-data.cc
trunk/src/gnome-cmd-data.h
trunk/src/gnome-cmd-xml-config.cc
Modified: trunk/src/gnome-cmd-data.cc
==============================================================================
--- trunk/src/gnome-cmd-data.cc (original)
+++ trunk/src/gnome-cmd-data.cc Sat Nov 29 14:54:53 2008
@@ -100,6 +100,29 @@
}
+void GnomeCmdData::AdvrenameConfig::fill_regex_model(Profile &profile)
+{
+ if (!regexes)
+ return;
+
+ GtkTreeIter iter;
+
+ for (vector<Profile::Regex>::const_iterator r=profile.regexes.begin(); r!=profile.regexes.end(); ++r)
+ {
+ GnomeCmdAdvrenameDialog::Regex *rx = new GnomeCmdAdvrenameDialog::Regex(r->pattern.c_str(), r->replace.c_str(), r->match_case);
+
+ gtk_list_store_append (GTK_LIST_STORE (regexes), &iter);
+ gtk_list_store_set (GTK_LIST_STORE (regexes), &iter,
+ GnomeCmdAdvrenameDialog::COL_REGEX, rx,
+ GnomeCmdAdvrenameDialog::COL_MALFORMED_REGEX, !*rx,
+ GnomeCmdAdvrenameDialog::COL_PATTERN, r->pattern.c_str(),
+ GnomeCmdAdvrenameDialog::COL_REPLACE, r->replace.c_str(),
+ GnomeCmdAdvrenameDialog::COL_MATCH_CASE, r->match_case ? _("Yes") : _("No"),
+ -1);
+ }
+}
+
+
inline gint get_int (const gchar *path, int def)
{
gboolean b = FALSE;
Modified: trunk/src/gnome-cmd-data.h
==============================================================================
--- trunk/src/gnome-cmd-data.h (original)
+++ trunk/src/gnome-cmd-data.h Sat Nov 29 14:54:53 2008
@@ -103,6 +103,8 @@
AdvrenameConfig(): width(600), height(400),
templates(ADVRENAME_HISTORY_SIZE), regexes(NULL) {}
~AdvrenameConfig() { if (regexes) g_object_unref (regexes); }
+
+ void fill_regex_model(Profile &profile);
};
struct IntViewerConfig
Modified: trunk/src/gnome-cmd-xml-config.cc
==============================================================================
--- trunk/src/gnome-cmd-xml-config.cc (original)
+++ trunk/src/gnome-cmd-xml-config.cc Sat Nov 29 14:54:53 2008
@@ -468,24 +468,8 @@
if (p!=cfg->advrename_defaults.profiles.end())
{
- GtkTreeIter iter;
-
cfg->advrename_defaults.default_profile = *p;
-
- for (std::vector<GnomeCmdData::AdvrenameConfig::Profile::Regex>::const_iterator r=p->regexes.begin(); r!=p->regexes.end(); ++r)
- {
- GnomeCmdAdvrenameDialog::Regex *rx = new GnomeCmdAdvrenameDialog::Regex(r->pattern.c_str(),r->replace.c_str(), r->match_case);
-
- gtk_list_store_append (GTK_LIST_STORE (cfg->advrename_defaults.regexes), &iter);
- gtk_list_store_set (GTK_LIST_STORE (cfg->advrename_defaults.regexes), &iter,
- GnomeCmdAdvrenameDialog::COL_REGEX, rx,
- GnomeCmdAdvrenameDialog::COL_MALFORMED_REGEX, !*rx,
- GnomeCmdAdvrenameDialog::COL_PATTERN, r->pattern.c_str(),
- GnomeCmdAdvrenameDialog::COL_REPLACE, r->replace.c_str(),
- GnomeCmdAdvrenameDialog::COL_MATCH_CASE, r->match_case ? _("Yes") : _("No"),
- -1);
- }
-
+ cfg->advrename_defaults.fill_regex_model(*p);
cfg->advrename_defaults.profiles.erase(p);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]