mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
Fix for Bug #222, config is always written to user location now
This commit is contained in:
parent
f1f6e21442
commit
fd4826d06f
@ -1057,16 +1057,8 @@ void DataFilesPage::writeConfig(QString profile)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare the OpenMW config
|
// Open the OpenMW config as a QFile
|
||||||
QString config = QString::fromStdString((mCfgMgr.getLocalPath() / "openmw.cfg").string());
|
QFile file(QString::fromStdString((mCfgMgr.getUserPath() / "openmw.cfg").string()));
|
||||||
QFile file(config);
|
|
||||||
|
|
||||||
if (!file.exists()) {
|
|
||||||
config = QString::fromStdString((mCfgMgr.getUserPath() / "openmw.cfg").string());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Open the config as a QFile
|
|
||||||
file.setFileName(config);
|
|
||||||
|
|
||||||
if (!file.open(QIODevice::ReadWrite | QIODevice::Text)) {
|
if (!file.open(QIODevice::ReadWrite | QIODevice::Text)) {
|
||||||
// File cannot be opened or created
|
// File cannot be opened or created
|
||||||
|
Loading…
Reference in New Issue
Block a user