Skip to content

Commit 48327b3

Browse files
committed
Add simple versioned autosave
Each autosave now adds a patterned file based on the time, to have a version history of sorts. I wager that people who have autosaves turned on will not be affected by too many files.
1 parent 807751d commit 48327b3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/gui/MainWindow.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,9 @@ void MainWindow::browseHelp()
13671367

13681368
void MainWindow::autoSave()
13691369
{
1370+
Song * song = Engine::getSong();
1371+
QString autoSaveVersionedName = song->projectFileName();
1372+
13701373
if( !Engine::getSong()->isExporting() &&
13711374
!Engine::getSong()->isLoadingProject() &&
13721375
!RemotePluginBase::isMainThreadWaiting() &&
@@ -1375,7 +1378,9 @@ void MainWindow::autoSave()
13751378
"enablerunningautosave" ).toInt() ||
13761379
! Engine::getSong()->isPlaying() ) )
13771380
{
1381+
//Recovery file is still needed for post-crash recovery dialog.
13781382
Engine::getSong()->saveProjectFile(ConfigManager::inst()->recoveryFile());
1383+
Engine::getSong()->saveProjectFile( autoSaveVersionedName.section('.', 0, 0).append(".").append("autosave").append(".").append(QDateTime::currentDateTime().toString("dd-MM-yyyy-hh-mm-ss-zzz")).append(".").append(autoSaveVersionedName.section('.', -1)) );
13791384
autoSaveTimerReset(); // Reset timer
13801385
}
13811386
else

0 commit comments

Comments
 (0)