X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fconfig.cc;h=2e40ab3087b8d5708db3e786d5108b58f2db400f;hb=985e727e001e1a92ae035364a9cbf1ff99522ff1;hp=c71f3acd3a561f8f728b5f6e2bf15893b2cbe6fc;hpb=e075012124424b77044b5d61885ed2646d3781cd;p=dcpomatic.git diff --git a/src/lib/config.cc b/src/lib/config.cc index c71f3acd3..2e40ab308 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -70,7 +70,6 @@ int const Config::_current_version = 3; boost::signals2::signal Config::FailedToLoad; boost::signals2::signal Config::Warning; boost::signals2::signal Config::BadSignerChain; -boost::optional Config::override_path; /** Construct default configuration */ Config::Config () @@ -609,33 +608,6 @@ catch (...) { write (); } -/** @return Filename to write configuration to */ -boost::filesystem::path -Config::path (string file, bool create_directories) -{ - boost::filesystem::path p; - if (override_path) { - p = *override_path; - } else { -#ifdef DCPOMATIC_OSX - p /= g_get_home_dir (); - p /= "Library"; - p /= "Preferences"; - p /= "com.dcpomatic"; - p /= "2"; -#else - p /= g_get_user_config_dir (); - p /= "dcpomatic2"; -#endif - } - boost::system::error_code ec; - if (create_directories) { - boost::filesystem::create_directories (p, ec); - } - p /= file; - return p; -} - /** @return Singleton instance */ Config * Config::instance () @@ -663,7 +635,7 @@ Config::write_config () const xmlpp::Element* root = doc.create_root_node ("Config"); /* [XML] Version The version number of the configuration file format. */ - root->add_child("Version")->add_child_text (String::compose ("%1", _current_version)); + root->add_child("Version")->add_child_text (raw_convert(_current_version)); /* [XML] MasterEncodingThreads Number of encoding threads to use when running as master. */ root->add_child("MasterEncodingThreads")->add_child_text (raw_convert (_master_encoding_threads)); /* [XML] ServerEncodingThreads Number of encoding threads to use when running as server. */