Remove unnecessary copy of mEngineSettings in mInitialSettings.

pull/820/head
cfcohen 9 years ago
parent 046538984c
commit a9c9cc5508

@ -80,8 +80,6 @@ bool Launcher::GraphicsPage::loadSettings()
if (!setupSDL()) if (!setupSDL())
return false; return false;
mInitialSettings = mEngineSettings;
if (mEngineSettings.getBool("vsync", "Video")) if (mEngineSettings.getBool("vsync", "Video"))
vSyncCheckBox->setCheckState(Qt::Checked); vSyncCheckBox->setCheckState(Qt::Checked);
@ -119,22 +117,22 @@ bool Launcher::GraphicsPage::loadSettings()
void Launcher::GraphicsPage::saveSettings() void Launcher::GraphicsPage::saveSettings()
{ {
bool iVSync = mInitialSettings.getBool("vsync", "Video"); bool iVSync = mEngineSettings.getBool("vsync", "Video");
bool cVSync = vSyncCheckBox->checkState(); bool cVSync = vSyncCheckBox->checkState();
if (iVSync != cVSync) if (iVSync != cVSync)
mEngineSettings.setBool("vsync", "Video", cVSync); mEngineSettings.setBool("vsync", "Video", cVSync);
bool iFullScreen = mInitialSettings.getBool("fullscreen", "Video"); bool iFullScreen = mEngineSettings.getBool("fullscreen", "Video");
bool cFullScreen = fullScreenCheckBox->checkState(); bool cFullScreen = fullScreenCheckBox->checkState();
if (iFullScreen != cFullScreen) if (iFullScreen != cFullScreen)
mEngineSettings.setBool("fullscreen", "Video", cFullScreen); mEngineSettings.setBool("fullscreen", "Video", cFullScreen);
bool iWindowBorder = mInitialSettings.getBool("window border", "Video"); bool iWindowBorder = mEngineSettings.getBool("window border", "Video");
bool cWindowBorder = windowBorderCheckBox->checkState(); bool cWindowBorder = windowBorderCheckBox->checkState();
if (iWindowBorder != cWindowBorder) if (iWindowBorder != cWindowBorder)
mEngineSettings.setBool("window border", "Video", cWindowBorder); mEngineSettings.setBool("window border", "Video", cWindowBorder);
int iAAValue = mInitialSettings.getInt("antialiasing", "Video"); int iAAValue = mEngineSettings.getInt("antialiasing", "Video");
// The atoi() call is safe because the pull down constrains the string values. // The atoi() call is safe because the pull down constrains the string values.
int cAAValue = atoi(antiAliasingComboBox->currentText().toLatin1().data()); int cAAValue = atoi(antiAliasingComboBox->currentText().toLatin1().data());
if (iAAValue != cAAValue) if (iAAValue != cAAValue)
@ -154,15 +152,15 @@ void Launcher::GraphicsPage::saveSettings()
cHeight = customHeightSpinBox->value(); cHeight = customHeightSpinBox->value();
} }
int iWidth = mInitialSettings.getInt("resolution x", "Video"); int iWidth = mEngineSettings.getInt("resolution x", "Video");
if (iWidth != cWidth) if (iWidth != cWidth)
mEngineSettings.setInt("resolution x", "Video", cWidth); mEngineSettings.setInt("resolution x", "Video", cWidth);
int iHeight = mInitialSettings.getInt("resolution y", "Video"); int iHeight = mEngineSettings.getInt("resolution y", "Video");
if (iHeight != cHeight) if (iHeight != cHeight)
mEngineSettings.setInt("resolution y", "Video", cHeight); mEngineSettings.setInt("resolution y", "Video", cHeight);
int iScreen = mInitialSettings.getInt("screen", "Video"); int iScreen = mEngineSettings.getInt("screen", "Video");
int cScreen = screenComboBox->currentIndex(); int cScreen = screenComboBox->currentIndex();
if (iScreen != cScreen) if (iScreen != cScreen)
mEngineSettings.setInt("screen", "Video", cScreen); mEngineSettings.setInt("screen", "Video", cScreen);

@ -33,7 +33,6 @@ namespace Launcher
private: private:
Files::ConfigurationManager &mCfgMgr; Files::ConfigurationManager &mCfgMgr;
Settings::Manager &mEngineSettings; Settings::Manager &mEngineSettings;
Settings::Manager mInitialSettings;
QStringList getAvailableResolutions(int screen); QStringList getAvailableResolutions(int screen);
QRect getMaximumResolution(); QRect getMaximumResolution();

Loading…
Cancel
Save