summaryrefslogtreecommitdiff
path: root/libs/ardour/configuration.cc
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2006-03-12 16:19:03 +0000
committerTim Mayberry <mojofunk@gmail.com>2006-03-12 16:19:03 +0000
commita8640ec0af8a477b35ddfd9b83d8704e63edf978 (patch)
tree74ef1d33983d911faec6671be963e22f2445e35e /libs/ardour/configuration.cc
parent670641c3df89af73de36efa5b0a184c2430275b0 (diff)
removed the following environment variables:
ARDOUR_GLADE_PATH ARDOUR_RC ARDOUR_UI ARDOUR_UI_RC ARDOUR_BINDINGS ARDOUR_COLORS They have been replaced with just one environment variable called ARDOUR_PATH which can contain a number of colon separated paths that are used to find various configuration and data files. Files located in ARDOUR_PATH have priority over files in ~/.ardour/ and in the system path. Moved two member functions of the Configuration class into globals.cc as they should of been static and I'm trying to keep the non-portable code together when it makes sense. git-svn-id: svn://localhost/trunk/ardour2@380 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/configuration.cc')
-rw-r--r--libs/ardour/configuration.cc73
1 files changed, 3 insertions, 70 deletions
diff --git a/libs/ardour/configuration.cc b/libs/ardour/configuration.cc
index 3b4ad4b45f..f73ba1052a 100644
--- a/libs/ardour/configuration.cc
+++ b/libs/ardour/configuration.cc
@@ -59,24 +59,12 @@ Configuration::~Configuration ()
string
Configuration::get_user_path()
{
- char *envvar;
-
- if ((envvar = getenv ("ARDOUR_RC")) != 0) {
- return envvar;
- }
-
return find_config_file ("ardour.rc");
}
string
Configuration::get_system_path()
{
- char* envvar;
-
- if ((envvar = getenv ("ARDOUR_SYSTEM_RC")) != 0) {
- return envvar;
- }
-
return find_config_file ("ardour_system.rc");
}
@@ -92,9 +80,7 @@ Configuration::load_state ()
if (rcfile.length()) {
XMLTree tree;
-
- cerr << "Loading system configuration file " << rcfile << endl;
-
+
if (!tree.read (rcfile.c_str())) {
error << string_compose(_("Ardour: cannot read system configuration file \"%1\""), rcfile) << endmsg;
return -1;
@@ -117,9 +103,7 @@ Configuration::load_state ()
if (rcfile.length()) {
XMLTree tree;
-
- cerr << "Loading user configuration file " << rcfile << endl;
-
+
if (!tree.read (rcfile)) {
error << string_compose(_("Ardour: cannot read configuration file \"%1\""), rcfile) << endmsg;
return -1;
@@ -140,28 +124,12 @@ Configuration::save_state()
{
XMLTree tree;
string rcfile;
- char *envvar;
/* Note: this only writes the per-user file, and therefore
only saves variables marked as user-set or modified
*/
- if ((envvar = getenv ("ARDOUR_RC")) != 0) {
- if (strlen (envvar) == 0) {
- return -1;
- }
- rcfile = envvar;
- } else {
-
- if ((envvar = getenv ("HOME")) == 0) {
- return -1;
- }
- if (strlen (envvar) == 0) {
- return -1;
- }
- rcfile = envvar;
- rcfile += "/.ardour/ardour.rc";
- }
+ rcfile = find_config_file("ardour.rc");
if (rcfile.length()) {
tree.set_root (&state (true));
@@ -1054,41 +1022,6 @@ Configuration::set_auto_xfade (bool yn)
}
}
-string
-Configuration::get_user_ardour_path ()
-{
- string path;
- char* envvar;
-
- if ((envvar = getenv ("HOME")) == 0 || strlen (envvar) == 0) {
- return "/";
- }
-
- path = envvar;
- path += "/.ardour/";
-
- return path;
-}
-
-string
-Configuration::get_system_ardour_path ()
-{
- string path;
- char* envvar;
-
- if ((envvar = getenv ("ARDOUR_DATA_PATH")) != 0) {
- path += envvar;
- if (path[path.length()-1] != ':') {
- path += ':';
- }
- }
-
- path += DATA_DIR;
- path += "/ardour/";
-
- return path;
-}
-
bool
Configuration::get_no_new_session_dialog()
{