[qet] qet/qet: [5814] Minor : When launch qet with a .qet as argument, the " restor backup" dialog ask user to restor the project freshly opened while this one wasn' t crashed.

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 5814
Author:   blacksun
Date:     2019-03-29 22:11:09 +0100 (Fri, 29 Mar 2019)
Log Message:
-----------
Minor : When launch qet with a .qet as argument, the "restor backup" dialog ask user to restor the project freshly opened while this one wasn't crashed.

Modified Paths:
--------------
    trunk/sources/qetapp.cpp

Modified: trunk/sources/qetapp.cpp
===================================================================
--- trunk/sources/qetapp.cpp	2019-03-29 20:51:24 UTC (rev 5813)
+++ trunk/sources/qetapp.cpp	2019-03-29 21:11:09 UTC (rev 5814)
@@ -1788,6 +1788,17 @@
 void QETApp::checkBackupFiles()
 {
 	QList<KAutoSaveFile *> stale_files = KAutoSaveFile::allStaleFiles();
+
+		//Remove from the list @stale_files, the stales file of opened project
+	const QList<KAutoSaveFile *> sf = stale_files;
+	for (KAutoSaveFile *kasf : sf) {
+		for (QETProject *project : registeredProjects().values()) {
+			if (kasf->managedFile() == QUrl(project->filePath())) {
+				stale_files.removeOne(kasf);
+			}
+		}
+	}
+
 	if (stale_files.isEmpty()) {
 		return;
 	}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/