1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-28 22:09:42 +00:00

issue 6685 - wizard failure if config dir does not exist

This commit is contained in:
Eris Caffee 2022-04-17 17:13:31 +00:00 committed by psi29a
parent 964f288c13
commit ba57d0651f

View file

@ -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;