diff --git a/sources/qetapp.cpp b/sources/qetapp.cpp index d8e625d4d..4f334c676 100644 --- a/sources/qetapp.cpp +++ b/sources/qetapp.cpp @@ -2660,14 +2660,28 @@ void QETApp::checkBackupFiles() } } - if (stale_files.isEmpty()) { - // Only offer an unretrieved crash dump when there's no project - // to recover this run -- discussion #644 step 5 is explicit - // that the two prompts must never both show at once. - checkCrashDump(); - return; + if (!stale_files.isEmpty()) { + offerBackupFiles(stale_files); } + // Discussion #644 step 5 asks that the recovery prompt and the crash + // report never show at the same time -- not that the report be dropped + // whenever there is something to recover. Offering it here, once the + // recovery prompt has been answered, keeps the two sequential without + // losing the report after the most common crash there is: one with a + // project open, which always leaves a stale file behind, so the report + // was unreachable in exactly the case it is most wanted (issue #901). + checkCrashDump(); +} + +/** + @brief QETApp::offerBackupFiles + Ask whether to reopen the recovery files left by a previous run, and + open or discard them accordingly. + @param stale_files : the recovery files to offer +*/ +void QETApp::offerBackupFiles(const QList &stale_files) +{ QString text; if(stale_files.size() == 1) { text.append(tr("Le fichier de restauration suivant a été trouvé,
" diff --git a/sources/qetapp.h b/sources/qetapp.h index ee793ecb6..7d0e5e7ee 100644 --- a/sources/qetapp.h +++ b/sources/qetapp.h @@ -31,6 +31,7 @@ class QSplashScreen; class QMenu; class QAction; class QMainWindow; +class KAutoSaveFile; #define QETAPP_COMMON_TBT_PROTOCOL "commontbt" #define QETAPP_COMPANY_TBT_PROTOCOL "companytbt" @@ -290,6 +291,7 @@ class QETApp : public QObject void initSystemTray(); void buildSystemTrayMenu(); void checkBackupFiles(); + void offerBackupFiles(const QList &stale_files); void checkCrashDump(); void fetchWindowStats( const QList &,