Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recover file fixes #3722

Merged
merged 1 commit into from
Jul 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions include/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ class MainWindow : public QMainWindow
return m_autoSaveTimer.interval();
}

void runAutoSave();

enum SessionState
{
Normal,
Expand Down
1 change: 0 additions & 1 deletion src/core/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,6 @@ int main( int argc, char * * argv )
if( autoSaveEnabled )
{
gui->mainWindow()->autoSaveTimerReset();
gui->mainWindow()->autoSave();
}
}

Expand Down
16 changes: 0 additions & 16 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,6 @@ void MainWindow::createNewProject()
{
Engine::getSong()->createNewProject();
}
runAutoSave();
}


Expand All @@ -840,7 +839,6 @@ void MainWindow::createNewProjectFromTemplate( QAction * _idx )
Engine::getSong()->createNewProjectFromTemplate(
dirBase + _idx->text() + ".mpt" );
}
runAutoSave();
}


Expand All @@ -865,7 +863,6 @@ void MainWindow::openProject()
setCursor( Qt::ArrowCursor );
}
}
runAutoSave();
}


Expand Down Expand Up @@ -917,7 +914,6 @@ void MainWindow::openRecentlyOpenedProject( QAction * _action )
Engine::getSong()->loadProject( f );
setCursor( Qt::ArrowCursor );
}
runAutoSave();
}


Expand Down Expand Up @@ -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
}
}
4 changes: 2 additions & 2 deletions src/gui/SetupDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() ),
Expand Down Expand Up @@ -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 );
}


Expand Down