From f2613a74b1fb329cd66f1ffdbb47a6e102d378ec Mon Sep 17 00:00:00 2001
From: tri4ng1e
Date: Thu, 17 May 2018 21:20:04 +0300
Subject: [PATCH] Write settings before invoking openmw-iniimporter
---
apps/wizard/mainwizard.cpp | 20 ++------------------
1 file changed, 2 insertions(+), 18 deletions(-)
diff --git a/apps/wizard/mainwizard.cpp b/apps/wizard/mainwizard.cpp
index 0f8fb0c495..57d080cf85 100644
--- a/apps/wizard/mainwizard.cpp
+++ b/apps/wizard/mainwizard.cpp
@@ -231,29 +231,13 @@ void Wizard::MainWizard::setupInstallations()
void Wizard::MainWizard::runSettingsImporter()
{
+ writeSettings();
+
QString path(field(QLatin1String("installation.path")).toString());
- // Create the file if it doesn't already exist, else the importer will fail
QString userPath(toQString(mCfgMgr.getUserConfigPath()));
QFile file(userPath + QLatin1String("openmw.cfg"));
- if (!file.exists()) {
- if (!file.open(QIODevice::ReadWrite)) {
- // File cannot be created
- QMessageBox msgBox;
- msgBox.setWindowTitle(tr("Error writing OpenMW configuration file"));
- msgBox.setIcon(QMessageBox::Critical);
- msgBox.setStandardButtons(QMessageBox::Ok);
- msgBox.setText(tr("
Could not open or create %1 for writing
\
- Please make sure you have the right permissions \
- and try again.
").arg(file.fileName()));
- msgBox.exec();
- return qApp->quit();
- }
-
- file.close();
- }
-
// Construct the arguments to run the importer
QStringList arguments;