From 98dc7649dc211716da0c41bff0759d082bab95f8 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 29 Apr 2018 00:37:13 +0100 Subject: Allow command-line configuration of config location (#1284). --- src/lib/config.cc | 6 +++--- src/lib/config.h | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/lib') 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 Config::FailedToLoad; boost::signals2::signal Config::Warning; boost::signals2::signal Config::BadSignerChain; -boost::optional Config::test_path; +boost::optional 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 test_path; - + /** If set, this overrides the standard path (in home, Library, AppData or wherever) for config.xml and cinemas.xml */ + static boost::optional override_path; + private: Config (); static boost::filesystem::path path (std::string file, bool create_directories = true); -- cgit v1.2.3