summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-04-29 00:37:13 +0100
committerCarl Hetherington <cth@carlh.net>2018-08-06 23:01:28 +0100
commit98dc7649dc211716da0c41bff0759d082bab95f8 (patch)
treec497d3b7e3188b28c1cbbed7939c8700a111626a /src/lib
parent02ceebef37974d4b76fe7007b5b6d28efd1c0657 (diff)
Allow command-line configuration of config location (#1284).
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/config.cc6
-rw-r--r--src/lib/config.h5
2 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 2ae7939a9..e2f2bbeb9 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -68,7 +68,7 @@ int const Config::_current_version = 3;
boost::signals2::signal<void ()> Config::FailedToLoad;
boost::signals2::signal<void (string)> Config::Warning;
boost::signals2::signal<bool (void)> Config::BadSignerChain;
-boost::optional<boost::filesystem::path> Config::test_path;
+boost::optional<boost::filesystem::path> Config::override_path;
/** Construct default configuration */
Config::Config ()
@@ -456,8 +456,8 @@ boost::filesystem::path
Config::path (string file, bool create_directories)
{
boost::filesystem::path p;
- if (test_path) {
- p = test_path.get();
+ if (override_path) {
+ p = *override_path;
} else {
#ifdef DCPOMATIC_OSX
p /= g_get_home_dir ();
diff --git a/src/lib/config.h b/src/lib/config.h
index 2fca9699c..c625e9242 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -721,8 +721,9 @@ public:
static bool have_existing (std::string);
static boost::filesystem::path config_file ();
- static boost::optional<boost::filesystem::path> test_path;
-
+ /** If set, this overrides the standard path (in home, Library, AppData or wherever) for config.xml and cinemas.xml */
+ static boost::optional<boost::filesystem::path> override_path;
+
private:
Config ();
static boost::filesystem::path path (std::string file, bool create_directories = true);