From 78c30ae9e440b5058d58aa5d23b9cf11b295a437 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Sat, 23 Jun 2012 05:07:12 +0000 Subject: Simplify ardour_*_search_path functions Also fixes portability but windows build will likely not rely on env variables git-svn-id: svn://localhost/ardour2/branches/3.0@12836 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/filesystem_paths.cc | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'libs/ardour/filesystem_paths.cc') diff --git a/libs/ardour/filesystem_paths.cc b/libs/ardour/filesystem_paths.cc index 834b1b3331..6866d4060f 100644 --- a/libs/ardour/filesystem_paths.cc +++ b/libs/ardour/filesystem_paths.cc @@ -21,7 +21,6 @@ #include "pbd/error.h" #include "pbd/compose.h" -#include "pbd/strsplit.h" #include "pbd/filesystem.h" #include @@ -105,11 +104,10 @@ ardour_dll_directory () SearchPath ardour_config_search_path () { - static bool have_path = false; static SearchPath search_path; - if (!have_path) { - SearchPath sp (user_config_directory()); + if (search_path.empty()) { + search_path += user_config_directory(); std::string s = Glib::getenv("ARDOUR_CONFIG_PATH"); if (s.empty()) { @@ -117,14 +115,7 @@ ardour_config_search_path () ::exit (1); } - std::vector ss; - split (s, ss, ':'); - for (std::vector::iterator i = ss.begin(); i != ss.end(); ++i) { - sp += *i; - } - - search_path = sp; - have_path = true; + search_path += SearchPath (s); } return search_path; @@ -133,11 +124,10 @@ ardour_config_search_path () SearchPath ardour_data_search_path () { - static bool have_path = false; static SearchPath search_path; - if (!have_path) { - SearchPath sp (user_config_directory()); + if (search_path.empty()) { + search_path += user_config_directory(); std::string s = Glib::getenv("ARDOUR_DATA_PATH"); if (s.empty()) { @@ -145,14 +135,7 @@ ardour_data_search_path () ::exit (1); } - std::vector ss; - split (s, ss, ':'); - for (std::vector::iterator i = ss.begin(); i != ss.end(); ++i) { - sp += *i; - } - - search_path = sp; - have_path = true; + search_path += SearchPath (s); } return search_path; -- cgit v1.2.3