diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-08-27 13:45:46 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-08-27 13:45:46 +0100 |
| commit | aa36b8c781059aa573a1465692bc9ae5973253f1 (patch) | |
| tree | 08905d7288dedf163f8b93914aaf1ed83cf7aa20 /src/lib | |
| parent | f60eb6a4f6b75a78899bbc96213450ac49d74e33 (diff) | |
Make sure we don't create any config directories until we've set up the i18n properly.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/config.cc | 8 | ||||
| -rw-r--r-- | src/lib/config.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index cec054aaa..4995793e9 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -269,7 +269,7 @@ Config::read () /** @return Filename to write configuration to */ boost::filesystem::path -Config::file () +Config::file (bool create_directories) { boost::filesystem::path p; #ifdef DCPOMATIC_OSX @@ -283,7 +283,9 @@ Config::file () p /= "dcpomatic2"; #endif boost::system::error_code ec; - boost::filesystem::create_directories (p, ec); + if (create_directories) { + boost::filesystem::create_directories (p, ec); + } p /= "config.xml"; return p; } @@ -468,5 +470,5 @@ Config::add_to_history (boost::filesystem::path p) bool Config::have_existing () { - return boost::filesystem::exists (file ()); + return boost::filesystem::exists (file (false)); } diff --git a/src/lib/config.h b/src/lib/config.h index 9d583ff6d..fc63c518c 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -432,7 +432,7 @@ public: private: Config (); - static boost::filesystem::path file (); + static boost::filesystem::path file (bool create_directories = true); void read (); void set_defaults (); void set_kdm_email_to_default (); |
