From 75c89f2c2277a942a9db4531ecd5ffecc660a497 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Fri, 7 Jun 2013 13:42:49 -0700 Subject: [PATCH] OK, I found the problem: duplication of state for the "autosave" option. Let's just use the QAction, as does everything else. --- interface/src/Application.cpp | 10 +++------- interface/src/Application.h | 3 --- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index ee66d13afd..49e91f6352 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -215,7 +215,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : _window->setCentralWidget(_glWidget); - // these are used, for example, to identify the application's preferences + // these are used, for example, to identify the application settings setApplicationName("Interface"); setOrganizationDomain("highfidelity.io"); setOrganizationName("High Fidelity"); @@ -968,7 +968,7 @@ void Application::terminate() { // Close serial port // close(serial_fd); - if (_autosave) { + if (_settingsAutosave->isChecked()) { saveSettings(); _settings->sync(); } @@ -1471,7 +1471,7 @@ void Application::initMenu() { debugMenu->addAction("Wants View Delta Sending", this, SLOT(setWantsDelta(bool)))->setCheckable(true); QMenu* settingsMenu = menuBar->addMenu("Settings"); - (_settingsAutosave = settingsMenu->addAction("Autosave", this, SLOT(setAutosave(bool))))->setCheckable(true); + (_settingsAutosave = settingsMenu->addAction("Autosave"))->setCheckable(true); _settingsAutosave->setChecked(true); settingsMenu->addAction("Load settings", this, SLOT(loadSettings())); settingsMenu->addAction("Save settings", this, SLOT(saveSettings())); @@ -2521,10 +2521,6 @@ void Application::saveAction(QSettings* set, QAction* action) { set->setValue(action->text(), action->isChecked()); } -void Application::setAutosave(bool wantsAutosave) { - _autosave = wantsAutosave; -} - void Application::loadSettings(QSettings* set) { if (!set) set = getSettings(); diff --git a/interface/src/Application.h b/interface/src/Application.h index 3fe1e8e4b5..2316f23dc0 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -112,7 +112,6 @@ private slots: void decreaseVoxelSize(); void increaseVoxelSize(); void chooseVoxelPaintColor(); - void setAutosave(bool wantsAutosave); void loadSettings(QSettings* set = NULL); void saveSettings(QSettings* set = NULL); void importSettings(); @@ -293,8 +292,6 @@ private: int _packetsPerSecond; int _bytesPerSecond; int _bytesCount; - - bool _autosave; // True if the autosave is on. }; #endif /* defined(__interface__Application__) */