From 6ec731c5faccb2295a1599b2453866c28d7af61e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 30 May 2016 12:19:09 -0400 Subject: 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). --- gtk2_ardour/utils.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'gtk2_ardour/utils.cc') 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 -ARDOUR_UI_UTILS::get_color_themes () +void +ARDOUR_UI_UTILS::get_color_themes (map& themes) { Searchpath spath(ARDOUR::theme_search_path()); - vector r; for (vector::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 -- cgit v1.2.3