diff options
-rw-r--r-- | libs/ardour/ardour/ardour.h | 5 | ||||
-rw-r--r-- | libs/ardour/globals.cc | 105 |
2 files changed, 0 insertions, 110 deletions
diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h index 83cf984bf6..8349b6f14b 100644 --- a/libs/ardour/ardour/ardour.h +++ b/libs/ardour/ardour/ardour.h @@ -50,11 +50,6 @@ namespace ARDOUR { int setup_midi(AudioEngine& engine); std::string get_ardour_revision (); - - std::string get_user_ardour_path (); - std::string get_system_data_path (); - - std::string find_data_file (std::string name, std::string subdir = "" ); const layer_t max_layer = UCHAR_MAX; diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index 6b416f3baf..aa04c8b091 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -366,111 +366,6 @@ ARDOUR::get_ardour_revision () return "$Rev$"; } -string -ARDOUR::get_user_ardour_path () -{ - string path; - char* envvar; - - if ((envvar = getenv ("HOME")) == 0 || strlen (envvar) == 0) { - return "/"; - } - - path = envvar; - path += "/.ardour2/"; - - /* create it if necessary */ - - if (g_mkdir_with_parents (path.c_str (), 0755)) { - throw exception (); - } - - return path; -} - -string -ARDOUR::get_system_data_path () -{ - string path; - - char *envvar; - - if ((envvar = getenv ("ARDOUR_DATA_PATH")) != 0) { - path = envvar; - } else { - path += DATA_DIR; - path += "/ardour2/"; - } - - return path; -} - -static string -find_file (string name, string dir, string subdir = "") -{ - string path; - char* envvar = getenv("ARDOUR_PATH"); - - /* 1st attempt: any directory in ARDOUR_PATH */ - - if (envvar != 0) { - - vector<string> split_path; - - split (envvar, split_path, ':'); - - for (vector<string>::iterator i = split_path.begin(); i != split_path.end(); ++i) { - path = *i; - path += "/" + name; - if (access (path.c_str(), R_OK) == 0) { - // cerr << "Using file " << path << " found in ARDOUR_PATH." << endl; - return path; - } - } - } - - /* 2nd attempt: ~/.ardour/ */ - - path = get_user_ardour_path(); - - if (subdir.length()) { - path += subdir + "/"; - } - - path += name; - if (access (path.c_str(), R_OK) == 0) { - return path; - } - - /* 3rd attempt: dir/... */ - - path = dir; - path += "/ardour2/"; - - if (subdir.length()) { - path += subdir + "/"; - } - - path += name; - - if (access (path.c_str(), R_OK) == 0) { - return path; - } - - return ""; -} - -string -ARDOUR::find_data_file (string name, string subdir) -{ - char* envvar; - if ((envvar = getenv("ARDOUR_DATA_PATH")) == 0) { - envvar = DATA_DIR; - } - - return find_file (name, envvar, subdir); -} - ARDOUR::LocaleGuard::LocaleGuard (const char* str) { old = strdup (setlocale (LC_NUMERIC, NULL)); |