diff --git a/apps/bulletobjecttool/main.cpp b/apps/bulletobjecttool/main.cpp index 5cb275a53d..66f710df72 100644 --- a/apps/bulletobjecttool/main.cpp +++ b/apps/bulletobjecttool/main.cpp @@ -125,6 +125,7 @@ namespace } Files::ConfigurationManager config; + config.processPaths(variables, std::filesystem::current_path()); config.readConfiguration(variables, desc); Debug::setupLogging(config.getLogPath(), applicationName); diff --git a/apps/essimporter/main.cpp b/apps/essimporter/main.cpp index f0833e9d81..50e11e2c5a 100644 --- a/apps/essimporter/main.cpp +++ b/apps/essimporter/main.cpp @@ -40,6 +40,7 @@ Allowed options)"); bpo::notify(variables); Files::ConfigurationManager cfgManager(true); + cfgManager.processPaths(variables, std::filesystem::current_path()); cfgManager.readConfiguration(variables, desc); const auto& essFile = variables["mwsave"].as(); diff --git a/apps/navmeshtool/main.cpp b/apps/navmeshtool/main.cpp index e148e60d54..65ee6df6b1 100644 --- a/apps/navmeshtool/main.cpp +++ b/apps/navmeshtool/main.cpp @@ -143,6 +143,7 @@ namespace NavMeshTool } Files::ConfigurationManager config; + config.processPaths(variables, std::filesystem::current_path()); config.readConfiguration(variables, desc); Debug::setupLogging(config.getLogPath(), applicationName); diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index 812a6ffd85..12b327c222 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -61,6 +61,8 @@ bool parseOptions(int argc, char** argv, OMW::Engine& engine, Files::Configurati return false; } + cfgMgr.processPaths(variables, std::filesystem::current_path()); + cfgMgr.readConfiguration(variables, desc); Debug::setupLogging(cfgMgr.getLogPath(), "OpenMW"); diff --git a/components/files/linuxpath.cpp b/components/files/linuxpath.cpp index 4dbe119917..aa8c410748 100644 --- a/components/files/linuxpath.cpp +++ b/components/files/linuxpath.cpp @@ -51,14 +51,6 @@ namespace Files LinuxPath::LinuxPath(const std::string& application_name) : mName(application_name) { - std::error_code ec; - current_path(getLocalPath(), ec); - const auto err = ec.value(); - if (err != 0) - { - Log(Debug::Warning) << "Error " << err << " " << std::generic_category().message(errno) - << " when changing current directory"; - } } std::filesystem::path LinuxPath::getUserConfigPath() const diff --git a/components/files/macospath.cpp b/components/files/macospath.cpp index 4b37c2fb26..f98bb72a8f 100644 --- a/components/files/macospath.cpp +++ b/components/files/macospath.cpp @@ -64,11 +64,6 @@ namespace Files MacOsPath::MacOsPath(const std::string& application_name) : mName(application_name) { - std::filesystem::path binary_path = getBinaryPath(); - std::error_code ec; - std::filesystem::current_path(binary_path.parent_path(), ec); - if (ec.value() != 0) - Log(Debug::Warning) << "Error " << ec.message() << " when changing current directory"; } std::filesystem::path MacOsPath::getUserConfigPath() const diff --git a/components/files/windowspath.cpp b/components/files/windowspath.cpp index 6fb9845976..77faa23131 100644 --- a/components/files/windowspath.cpp +++ b/components/files/windowspath.cpp @@ -26,10 +26,6 @@ namespace Files WindowsPath::WindowsPath(const std::string& application_name) : mName(application_name) { - std::error_code ec; - current_path(getLocalPath(), ec); - if (ec.value() != 0) - Log(Debug::Warning) << "Error " << ec.value() << " when changing current directory"; } std::filesystem::path WindowsPath::getUserConfigPath() const