summaryrefslogtreecommitdiff
path: root/gtk2_ardour/utils.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-05-30 12:19:09 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-05-31 15:30:46 -0400
commit6ec731c5faccb2295a1599b2453866c28d7af61e (patch)
tree51089d5eeae962523e346725c523968dc4c11747 /gtk2_ardour/utils.cc
parentae314207b1b04ba231bd05c3e1bedf6cb9c30b3f (diff)
rework of color theme file management
Use program-name + version when saving user color files (and search for them) Preset XML-defined theme name, but use filename in config files (could be wrong).
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r--gtk2_ardour/utils.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc
index 12c01fb7d0..e8dc568828 100644
--- a/gtk2_ardour/utils.cc
+++ b/gtk2_ardour/utils.cc
@@ -418,11 +418,10 @@ ARDOUR_UI_UTILS::get_xpm (std::string name)
return xpm_map[name];
}
-vector<string>
-ARDOUR_UI_UTILS::get_color_themes ()
+void
+ARDOUR_UI_UTILS::get_color_themes (map<std::string,std::string>& themes)
{
Searchpath spath(ARDOUR::theme_search_path());
- vector<string> r;
for (vector<string>::iterator s = spath.begin(); s != spath.end(); ++s) {
@@ -441,11 +440,15 @@ ARDOUR_UI_UTILS::get_color_themes ()
continue;
}
- r.push_back (Glib::filename_to_utf8 (basename_nosuffix(*e)));
+ XMLProperty const* prop = root->property (X_("theme-name"));
+
+ if (!prop) {
+ continue;
+ }
+
+ themes.insert (make_pair (prop->value(), Glib::filename_to_utf8 (basename_nosuffix(*e))));
}
}
-
- return r;
}
vector<string>