mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
Remove user preference setting option.
This commit is contained in:
parent
a439f49c4d
commit
d3b7cf44d3
@ -490,16 +490,7 @@ bool Launcher::MainDialog::writeSettings()
|
||||
// Game settings
|
||||
QFile file(userPath + QString("openmw.cfg"));
|
||||
|
||||
QIODevice::OpenMode mode(0);
|
||||
bool keepComments = mLauncherSettings.value(QString("Settings/keep-comments"), QString("true"))
|
||||
== QLatin1String("true");
|
||||
|
||||
if (keepComments)
|
||||
mode = QIODevice::ReadWrite | QIODevice::Text;
|
||||
else
|
||||
mode = QIODevice::ReadWrite | QIODevice::Text | QIODevice::Truncate;
|
||||
|
||||
if (!file.open(mode)) {
|
||||
if (!file.open(QIODevice::ReadWrite | QIODevice::Text)) {
|
||||
// File cannot be opened or created
|
||||
QMessageBox msgBox;
|
||||
msgBox.setWindowTitle(tr("Error writing OpenMW configuration file"));
|
||||
@ -512,16 +503,8 @@ bool Launcher::MainDialog::writeSettings()
|
||||
return false;
|
||||
}
|
||||
|
||||
QTextStream stream(&file);
|
||||
|
||||
if (keepComments)
|
||||
mGameSettings.writeFileWithComments(file);
|
||||
else
|
||||
{
|
||||
stream.setCodec(QTextCodec::codecForName("UTF-8"));
|
||||
mGameSettings.writeFile(stream);
|
||||
}
|
||||
|
||||
mGameSettings.writeFileWithComments(file);
|
||||
file.close();
|
||||
|
||||
// Graphics settings
|
||||
@ -540,6 +523,7 @@ bool Launcher::MainDialog::writeSettings()
|
||||
return false;
|
||||
}
|
||||
|
||||
QTextStream stream(&file);
|
||||
stream.setDevice(&file);
|
||||
stream.setCodec(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
|
@ -260,10 +260,6 @@ void Launcher::SettingsPage::saveSettings()
|
||||
} else {
|
||||
mGameSettings.setValue(QLatin1String("encoding"), QLatin1String("win1252"));
|
||||
}
|
||||
|
||||
QString keepComments(saveCommentsCheckBox->isChecked() ? "true" : "false");
|
||||
|
||||
mLauncherSettings.setValue(QLatin1String("Settings/keep-comments"), keepComments);
|
||||
}
|
||||
|
||||
bool Launcher::SettingsPage::loadSettings()
|
||||
@ -275,9 +271,5 @@ bool Launcher::SettingsPage::loadSettings()
|
||||
if (index != -1)
|
||||
languageComboBox->setCurrentIndex(index);
|
||||
|
||||
QString keepComments(mLauncherSettings.value(QLatin1String("Settings/keep-comments")));
|
||||
|
||||
saveCommentsCheckBox->setChecked(keepComments == "true");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -40,16 +40,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="saveCommentsCheckBox">
|
||||
<property name="text">
|
||||
<string>Keep comments in openmw.cfg</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
Reference in New Issue
Block a user