From a9c9cc5508f49dc095fd5e518dab93239646620a Mon Sep 17 00:00:00 2001 From: cfcohen Date: Thu, 26 Nov 2015 10:42:43 -0500 Subject: [PATCH] Remove unnecessary copy of mEngineSettings in mInitialSettings. --- apps/launcher/graphicspage.cpp | 16 +++++++--------- apps/launcher/graphicspage.hpp | 1 - 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp index d7f045f80e..f56c978884 100644 --- a/apps/launcher/graphicspage.cpp +++ b/apps/launcher/graphicspage.cpp @@ -80,8 +80,6 @@ bool Launcher::GraphicsPage::loadSettings() if (!setupSDL()) return false; - mInitialSettings = mEngineSettings; - if (mEngineSettings.getBool("vsync", "Video")) vSyncCheckBox->setCheckState(Qt::Checked); @@ -119,22 +117,22 @@ bool Launcher::GraphicsPage::loadSettings() void Launcher::GraphicsPage::saveSettings() { - bool iVSync = mInitialSettings.getBool("vsync", "Video"); + bool iVSync = mEngineSettings.getBool("vsync", "Video"); bool cVSync = vSyncCheckBox->checkState(); if (iVSync != cVSync) mEngineSettings.setBool("vsync", "Video", cVSync); - bool iFullScreen = mInitialSettings.getBool("fullscreen", "Video"); + bool iFullScreen = mEngineSettings.getBool("fullscreen", "Video"); bool cFullScreen = fullScreenCheckBox->checkState(); if (iFullScreen != cFullScreen) mEngineSettings.setBool("fullscreen", "Video", cFullScreen); - bool iWindowBorder = mInitialSettings.getBool("window border", "Video"); + bool iWindowBorder = mEngineSettings.getBool("window border", "Video"); bool cWindowBorder = windowBorderCheckBox->checkState(); if (iWindowBorder != 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. int cAAValue = atoi(antiAliasingComboBox->currentText().toLatin1().data()); if (iAAValue != cAAValue) @@ -154,15 +152,15 @@ void Launcher::GraphicsPage::saveSettings() cHeight = customHeightSpinBox->value(); } - int iWidth = mInitialSettings.getInt("resolution x", "Video"); + int iWidth = mEngineSettings.getInt("resolution x", "Video"); if (iWidth != cWidth) mEngineSettings.setInt("resolution x", "Video", cWidth); - int iHeight = mInitialSettings.getInt("resolution y", "Video"); + int iHeight = mEngineSettings.getInt("resolution y", "Video"); if (iHeight != cHeight) mEngineSettings.setInt("resolution y", "Video", cHeight); - int iScreen = mInitialSettings.getInt("screen", "Video"); + int iScreen = mEngineSettings.getInt("screen", "Video"); int cScreen = screenComboBox->currentIndex(); if (iScreen != cScreen) mEngineSettings.setInt("screen", "Video", cScreen); diff --git a/apps/launcher/graphicspage.hpp b/apps/launcher/graphicspage.hpp index 0958f07dae..e6eb53a3b7 100644 --- a/apps/launcher/graphicspage.hpp +++ b/apps/launcher/graphicspage.hpp @@ -33,7 +33,6 @@ namespace Launcher private: Files::ConfigurationManager &mCfgMgr; Settings::Manager &mEngineSettings; - Settings::Manager mInitialSettings; QStringList getAvailableResolutions(int screen); QRect getMaximumResolution();