From 5f2be0acc6e1fd0ab951444b8eb5d59cf11caa20 Mon Sep 17 00:00:00 2001 From: Oskar Wallgren Date: Sun, 30 Jul 2017 11:43:48 +0200 Subject: [PATCH] Fixes to recover file system (#3722) Don't auto-save while playing by default. On weaker machines (xp?) we see glitches so better turn this on after need. Remove the last of Limited Sessin which was removed in 648daee. --- include/MainWindow.h | 2 -- src/core/main.cpp | 1 - src/gui/MainWindow.cpp | 16 ---------------- src/gui/SetupDialog.cpp | 4 ++-- 4 files changed, 2 insertions(+), 21 deletions(-) diff --git a/include/MainWindow.h b/include/MainWindow.h index 41fc06d5d14..69b430d3343 100644 --- a/include/MainWindow.h +++ b/include/MainWindow.h @@ -105,8 +105,6 @@ class MainWindow : public QMainWindow return m_autoSaveTimer.interval(); } - void runAutoSave(); - enum SessionState { Normal, diff --git a/src/core/main.cpp b/src/core/main.cpp index 8d30a1912a2..b36ca0055c3 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -919,7 +919,6 @@ int main( int argc, char * * argv ) if( autoSaveEnabled ) { gui->mainWindow()->autoSaveTimerReset(); - gui->mainWindow()->autoSave(); } } diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 8c2898da382..63b931823c9 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -821,7 +821,6 @@ void MainWindow::createNewProject() { Engine::getSong()->createNewProject(); } - runAutoSave(); } @@ -840,7 +839,6 @@ void MainWindow::createNewProjectFromTemplate( QAction * _idx ) Engine::getSong()->createNewProjectFromTemplate( dirBase + _idx->text() + ".mpt" ); } - runAutoSave(); } @@ -865,7 +863,6 @@ void MainWindow::openProject() setCursor( Qt::ArrowCursor ); } } - runAutoSave(); } @@ -917,7 +914,6 @@ void MainWindow::openRecentlyOpenedProject( QAction * _action ) Engine::getSong()->loadProject( f ); setCursor( Qt::ArrowCursor ); } - runAutoSave(); } @@ -1557,15 +1553,3 @@ void MainWindow::autoSave() } } } - - -// For the occasional auto save action that isn't run -// from the timer where we need to do extra tests. -void MainWindow::runAutoSave() -{ - if( ConfigManager::inst()->value( "ui", "enableautosave" ).toInt() ) - { - autoSave(); - autoSaveTimerReset(); // Reset timer - } -} diff --git a/src/gui/SetupDialog.cpp b/src/gui/SetupDialog.cpp index 9f135784e47..879c1b7b9d9 100644 --- a/src/gui/SetupDialog.cpp +++ b/src/gui/SetupDialog.cpp @@ -120,7 +120,7 @@ SetupDialog::SetupDialog( ConfigTabs _tab_to_open ) : m_backgroundArtwork( QDir::toNativeSeparators( ConfigManager::inst()->backgroundArtwork() ) ), m_smoothScroll( ConfigManager::inst()->value( "ui", "smoothscroll" ).toInt() ), m_enableAutoSave( ConfigManager::inst()->value( "ui", "enableautosave", "1" ).toInt() ), - m_enableRunningAutoSave( ConfigManager::inst()->value( "ui", "enablerunningautosave", "1" ).toInt() ), + m_enableRunningAutoSave( ConfigManager::inst()->value( "ui", "enablerunningautosave", "0" ).toInt() ), m_saveInterval( ConfigManager::inst()->value( "ui", "saveinterval" ).toInt() < 1 ? MainWindow::DEFAULT_SAVE_INTERVAL_MINUTES : ConfigManager::inst()->value( "ui", "saveinterval" ).toInt() ), @@ -1518,7 +1518,7 @@ void SetupDialog::resetAutoSave() { setAutoSaveInterval( MainWindow::DEFAULT_SAVE_INTERVAL_MINUTES ); m_autoSave->setChecked( true ); - m_runningAutoSave->setChecked( true ); + m_runningAutoSave->setChecked( false ); }