Merge branch 'issue-6685' into 'master'

issue 6685 - wizard failure if config dir does not exist

See merge request OpenMW/openmw!1735
pull/3226/head
psi29a 3 years ago
commit 4575df957e

@ -4,6 +4,7 @@
#include <components/misc/helpviewer.hpp>
#include <QDate>
#include <QDir>
#include <QMessageBox>
#include <QFontDatabase>
#include <QFileDialog>
@ -153,6 +154,20 @@ Launcher::FirstRunDialogResult Launcher::MainDialog::showFirstRunDialog()
if (!setupLauncherSettings())
return FirstRunDialogResultFailure;
// Dialog wizard and setup will fail if the config directory does not already exist
QDir userConfigDir = QDir(QString::fromStdString(mCfgMgr.getUserConfigPath().string()));
if ( ! userConfigDir.exists() ) {
if ( ! userConfigDir.mkpath(".") )
{
cfgError(tr("Error opening OpenMW configuration file"),
tr("<br><b>Could not create directory %0</b><br><br> \
Please make sure you have the right permissions \
and try again.<br>").arg(userConfigDir.canonicalPath())
);
return FirstRunDialogResultFailure;
}
}
if (mLauncherSettings.value(QString("General/firstrun"), QString("true")) == QLatin1String("true"))
{
QMessageBox msgBox;

Loading…
Cancel
Save