summaryrefslogtreecommitdiff
path: root/libs/ardour/filesystem_paths.cc
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2012-06-23 05:07:12 +0000
committerTim Mayberry <mojofunk@gmail.com>2012-06-23 05:07:12 +0000
commit78c30ae9e440b5058d58aa5d23b9cf11b295a437 (patch)
treebf7ec5385def6d462bab33bddd50cc089d048384 /libs/ardour/filesystem_paths.cc
parent69c518f91e2f89722359699ef6c2b62467e2b56e (diff)
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
Diffstat (limited to 'libs/ardour/filesystem_paths.cc')
-rw-r--r--libs/ardour/filesystem_paths.cc29
1 files changed, 6 insertions, 23 deletions
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 <glibmm/miscutils.h>
@@ -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<string> ss;
- split (s, ss, ':');
- for (std::vector<string>::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<string> ss;
- split (s, ss, ':');
- for (std::vector<string>::iterator i = ss.begin(); i != ss.end(); ++i) {
- sp += *i;
- }
-
- search_path = sp;
- have_path = true;
+ search_path += SearchPath (s);
}
return search_path;