From fe36f02b81d740bedfe04c08027748735e2bf1ba Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 9 Feb 2025 23:35:30 +0100 Subject: Remove believed pointless pre-storage of file state. I think I previously misunderstood what was going on here and thought the problem was that doing set_cinemas_file() created a sqlite3 file. I now think that the problem is rather that we call Config::instance() early in dcpomatic.cc, then ::drop(). This creates the sqlite3 file, sets its path in the Config object but then deletes the object without saving it. When we create the Config object "for real" we don't reset the path from XML to sqlite3. The part of the previous fix that unconditionally sets the config path seems to be the right one. --- src/lib/config.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/config.cc b/src/lib/config.cc index 4440aab4d..79584326c 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -700,11 +700,10 @@ Config::instance() if (cinemas_file.extension() == ".xml") { auto sqlite = cinemas_file; sqlite.replace_extension(".sqlite3"); - bool const had_sqlite = dcp::filesystem::exists(sqlite); _instance->set_cinemas_file(sqlite); - if (dcp::filesystem::exists(cinemas_file) && !had_sqlite) { + if (dcp::filesystem::exists(cinemas_file) && !dcp::filesystem::exists(sqlite)) { CinemaList cinemas; cinemas.read_legacy_file(cinemas_file); } -- cgit v1.2.3