From c91a9f89edbdd4d5d21c8d11207eb4d74d57df04 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Wed, 6 Apr 2011 18:29:08 +0200 Subject: [PATCH] Ask whether to recover session after unexpected exit Instead of always loading the last auto-saved session (which might end up in an endless cycle if recover.mmp is faulty or causes a crash) ask the user whether to do so. (cherry picked from commit babf3edff8653fbc995bc944f1ee1826b7d23c56) --- src/core/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/main.cpp b/src/core/main.cpp index 77a456ded..432f23973 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -460,7 +461,11 @@ int main( int argc, char * * argv ) // recover a file? QString recoveryFile = QDir(configManager::inst()->workingDir()).absoluteFilePath("recover.mmp"); - if( QFileInfo(recoveryFile).exists() ) + if( QFileInfo(recoveryFile).exists() && + QMessageBox::question( engine::mainWindow(), MainWindow::tr( "Project recovery" ), + MainWindow::tr( "It looks like the last session did not end properly. " + "Do you want to recover the project of this session?" ), + QMessageBox::Yes | QMessageBox::No ) == QMessageBox::Yes ) { file_to_load = recoveryFile; }