@@ -2565,7 +2565,7 @@ void MainWindow::saveArchiveList()
25652565 }
25662566 }
25672567 }
2568- archiveFile. commitIfDifferent (m_ArchiveListHash );
2568+ archiveFile-> commit ( );
25692569 } else {
25702570 log::debug (" archive list not initialised" );
25712571 }
@@ -3773,16 +3773,25 @@ QString MainWindow::queryRestore(const QString& filePath)
37733773 SelectionDialog dialog (tr (" Choose backup to restore" ), this );
37743774 QRegularExpression exp (QRegularExpression::anchoredPattern (pluginFileInfo.fileName () +
37753775 PATTERN_BACKUP_REGEX));
3776- QRegularExpression exp2 (
3776+ // match orphaned SafeWriteFile temporaries
3777+ QRegularExpression exp2 (QRegularExpression::anchoredPattern (
3778+ pluginFileInfo.fileName () + " \\ .([A-Za-z]{6})" ));
3779+ QRegularExpression exp3 (
37773780 QRegularExpression::anchoredPattern (pluginFileInfo.fileName () + " \\ .(.*)" ));
37783781 for (const QFileInfo& info : boost::adaptors::reverse (files)) {
37793782 auto match = exp.match (info.fileName ());
37803783 auto match2 = exp2.match (info.fileName ());
3784+ auto match3 = exp3.match (info.fileName ());
37813785 if (match.hasMatch ()) {
37823786 QDateTime time = QDateTime::fromString (match.captured (1 ), PATTERN_BACKUP_DATE);
37833787 dialog.addChoice (time.toString (), " " , match.captured (1 ));
37843788 } else if (match2.hasMatch ()) {
3785- dialog.addChoice (match2.captured (1 ), " " , match2.captured (1 ));
3789+ dialog.addChoice (match2.captured (1 ),
3790+ tr (" This file might be left over following a crash or power "
3791+ " loss event. Check its contents before restoring." ),
3792+ match2.captured (1 ));
3793+ } else if (match3.hasMatch ()) {
3794+ dialog.addChoice (match3.captured (1 ), " " , match3.captured (1 ));
37863795 }
37873796 }
37883797
0 commit comments