projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
on session-load: skip output-change-handler until IOs are restored
[ardour.git]
/
libs
/
ardour
/
filesystem_paths.cc
diff --git
a/libs/ardour/filesystem_paths.cc
b/libs/ardour/filesystem_paths.cc
index a8a684a4aa9ab5423a92ae44babdaad85532e6a3..73bfaff137f726c0b9854d9516d552ebf8d7e958 100644
(file)
--- 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/error.h"
#include "pbd/compose.h"
-#include "pbd/strsplit.h"
#include <glibmm/miscutils.h>
#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
#include <glibmm/fileutils.h>
@@
-37,15
+36,15
@@
namespace ARDOUR {
using std::string;
using std::string;
-s
ys::path
+s
td::string
user_config_directory ()
{
user_config_directory ()
{
- s
ys::path
p;
+ s
tatic std::string
p;
-#ifdef __APPLE__
- p = Glib::get_home_dir();
- p /= "Library/Preferences";
+ if (!p.empty()) return p;
+#ifdef __APPLE__
+ p = Glib::build_filename (Glib::get_home_dir(), "Library/Preferences");
#else
const char* c = 0;
#else
const char* c = 0;
@@
-58,39
+57,33
@@
user_config_directory ()
const string home_dir = Glib::get_home_dir();
if (home_dir.empty ()) {
const string home_dir = Glib::get_home_dir();
if (home_dir.empty ()) {
- const string error_msg = "Unable to determine home directory";
-
- // log the error
- error << error_msg << endmsg;
-
- throw sys::filesystem_error(error_msg);
+ error << "Unable to determine home directory" << endmsg;
+ exit (1);
}
p = home_dir;
}
p = home_dir;
- p
/= ".config"
;
+ p
= Glib::build_filename (p, ".config")
;
}
#endif
}
#endif
- p
/= user_config_dir_name
;
+ p
= Glib::build_filename (p, user_config_dir_name)
;
- std::string ps (p.to_string());
-
- if (!Glib::file_test (ps, Glib::FILE_TEST_EXISTS)) {
- if (g_mkdir_with_parents (ps.c_str(), 0755)) {
+ if (!Glib::file_test (p, Glib::FILE_TEST_EXISTS)) {
+ if (g_mkdir_with_parents (p.c_str(), 0755)) {
error << string_compose (_("Cannot create Configuration directory %1 - cannot run"),
error << string_compose (_("Cannot create Configuration directory %1 - cannot run"),
- p
s
) << endmsg;
+ p) << endmsg;
exit (1);
}
exit (1);
}
- } else if (!Glib::file_test (p
s
, Glib::FILE_TEST_IS_DIR)) {
+ } else if (!Glib::file_test (p, Glib::FILE_TEST_IS_DIR)) {
error << string_compose (_("Configuration directory %1 already exists and is not a directory/folder - cannot run"),
error << string_compose (_("Configuration directory %1 already exists and is not a directory/folder - cannot run"),
- p
s
) << endmsg;
+ p) << endmsg;
exit (1);
}
return p;
}
exit (1);
}
return p;
}
-s
ys::path
+s
td::string
ardour_dll_directory ()
{
std::string s = Glib::getenv("ARDOUR_DLL_PATH");
ardour_dll_directory ()
{
std::string s = Glib::getenv("ARDOUR_DLL_PATH");
@@
-98,17
+91,16
@@
ardour_dll_directory ()
std::cerr << _("ARDOUR_DLL_PATH not set in environment - exiting\n");
::exit (1);
}
std::cerr << _("ARDOUR_DLL_PATH not set in environment - exiting\n");
::exit (1);
}
- return s
ys::path (s)
;
+ return s;
}
SearchPath
ardour_config_search_path ()
{
}
SearchPath
ardour_config_search_path ()
{
- static bool have_path = false;
static SearchPath search_path;
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()) {
std::string s = Glib::getenv("ARDOUR_CONFIG_PATH");
if (s.empty()) {
@@
-116,15
+108,7
@@
ardour_config_search_path ()
::exit (1);
}
::exit (1);
}
- std::vector<string> ss;
- split (s, ss, ':');
- for (std::vector<string>::iterator i = ss.begin(); i != ss.end(); ++i) {
- sp += sys::path (*i);
- }
-
- search_path = sp;
- have_path = true;
- info << "CONFIG PATH: " << search_path.to_string() << endmsg;
+ search_path += SearchPath (s);
}
return search_path;
}
return search_path;
@@
-133,11
+117,10
@@
ardour_config_search_path ()
SearchPath
ardour_data_search_path ()
{
SearchPath
ardour_data_search_path ()
{
- static bool have_path = false;
static SearchPath search_path;
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()) {
std::string s = Glib::getenv("ARDOUR_DATA_PATH");
if (s.empty()) {
@@
-145,15
+128,7
@@
ardour_data_search_path ()
::exit (1);
}
::exit (1);
}
- std::vector<string> ss;
- split (s, ss, ':');
- for (std::vector<string>::iterator i = ss.begin(); i != ss.end(); ++i) {
- sp += sys::path (*i);
- }
-
- search_path = sp;
- have_path = true;
- info << "DATA PATH: " << search_path.to_string() << endmsg;
+ search_path += SearchPath (s);
}
return search_path;
}
return search_path;