From 322a378907b034abfd722a861c7ab04f929ea0fb Mon Sep 17 00:00:00 2001 From: AnyOldName3 Date: Wed, 28 Feb 2024 00:49:15 +0000 Subject: [PATCH] Load correct config files in the wizard --- apps/wizard/main.cpp | 2 +- apps/wizard/mainwizard.cpp | 8 +++----- apps/wizard/mainwizard.hpp | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/wizard/main.cpp b/apps/wizard/main.cpp index b62428f946..e740f06015 100644 --- a/apps/wizard/main.cpp +++ b/apps/wizard/main.cpp @@ -47,7 +47,7 @@ int main(int argc, char* argv[]) l10n::installQtTranslations(app, "wizard", resourcesPath); - Wizard::MainWizard wizard; + Wizard::MainWizard wizard(std::move(configurationManager)); wizard.show(); return app.exec(); diff --git a/apps/wizard/mainwizard.cpp b/apps/wizard/mainwizard.cpp index 2f1f373cfd..e8bd6f7007 100644 --- a/apps/wizard/mainwizard.cpp +++ b/apps/wizard/mainwizard.cpp @@ -26,9 +26,10 @@ using namespace Process; -Wizard::MainWizard::MainWizard(QWidget* parent) +Wizard::MainWizard::MainWizard(Files::ConfigurationManager&& cfgMgr, QWidget* parent) : QWizard(parent) , mInstallations() + , mCfgMgr(cfgMgr) , mError(false) , mGameSettings(mCfgMgr) { @@ -172,10 +173,7 @@ void Wizard::MainWizard::setupGameSettings() file.close(); // Now the rest - QStringList paths; - paths.append(Files::getUserConfigPathQString(mCfgMgr)); - paths.append(QLatin1String("openmw.cfg")); - paths.append(Files::getGlobalConfigPathQString(mCfgMgr)); + QStringList paths = Files::getActiveConfigPathsQString(mCfgMgr); for (const QString& path2 : paths) { diff --git a/apps/wizard/mainwizard.hpp b/apps/wizard/mainwizard.hpp index 60f46fa1a5..2f120f1955 100644 --- a/apps/wizard/mainwizard.hpp +++ b/apps/wizard/mainwizard.hpp @@ -45,7 +45,7 @@ namespace Wizard Page_Conclusion }; - MainWizard(QWidget* parent = nullptr); + MainWizard(Files::ConfigurationManager&& cfgMgr, QWidget* parent = nullptr); ~MainWizard() override; bool findFiles(const QString& name, const QString& path);