Bump ffmpeg to 5.1.2 "Riemann"
[dcpomatic.git] / src / lib / state.cc
index e22f9e0b98bd71d37f4e6947d1563b1b6afd01c2..7a3232ee9c357e9edbdd21eb80c4266a3314de38 100644 (file)
@@ -22,7 +22,7 @@
 #include "cross.h"
 #include "state.h"
 #include "util.h"
-#include <glib.h>
+#include <dcp/filesystem.h>
 
 
 using std::string;
@@ -35,7 +35,7 @@ boost::optional<boost::filesystem::path> State::override_path;
 /* List of config versions to look for in descending order of preference;
  * i.e. look at the first one, and if that doesn't exist, try the second, etc.
  */
-static std::vector<std::string> config_versions = { "2.16" };
+static std::vector<std::string> config_versions = { "2.18", "2.16" };
 
 
 static
@@ -60,11 +60,9 @@ config_path_or_override (optional<string> version)
 boost::filesystem::path
 State::read_path (string file)
 {
-       using namespace boost::filesystem;
-
        for (auto i: config_versions) {
                auto full = config_path_or_override(i) / file;
-               if (exists(full)) {
+               if (dcp::filesystem::exists(full)) {
                        return full;
                }
        }
@@ -79,9 +77,8 @@ State::read_path (string file)
 boost::filesystem::path
 State::write_path (string file)
 {
-       boost::filesystem::path p = config_path_or_override(config_versions.front());
-       boost::system::error_code ec;
-       boost::filesystem::create_directories (p, ec);
+       auto p = config_path_or_override(config_versions.front());
+       dcp::filesystem::create_directories(p);
        p /= file;
        return p;
 }