mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 01:10:53 +01:00
Fix unwanted restore dialog who appear for the current project
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5936 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -1791,9 +1791,13 @@ void QETApp::checkBackupFiles()
|
|||||||
|
|
||||||
//Remove from the list @stale_files, the stales file of opened project
|
//Remove from the list @stale_files, the stales file of opened project
|
||||||
const QList<KAutoSaveFile *> sf = stale_files;
|
const QList<KAutoSaveFile *> sf = stale_files;
|
||||||
for (KAutoSaveFile *kasf : sf) {
|
for (KAutoSaveFile *kasf : sf)
|
||||||
for (QETProject *project : registeredProjects().values()) {
|
{
|
||||||
if (kasf->managedFile() == QUrl::fromLocalFile(project->filePath())) {
|
for (QETProject *project : registeredProjects().values())
|
||||||
|
{
|
||||||
|
//We must to adjust with the flag QUrl::StripTrailingSlash to compar a path formated like the path returned by KAutoSaveFile
|
||||||
|
const QString path = QUrl::fromLocalFile(project->filePath()).adjusted(QUrl::RemoveScheme | QUrl::StripTrailingSlash).path();
|
||||||
|
if (kasf->managedFile() == path) {
|
||||||
stale_files.removeOne(kasf);
|
stale_files.removeOne(kasf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1811,8 +1815,14 @@ void QETApp::checkBackupFiles()
|
|||||||
text.append(tr("<b>Les fichiers de restauration suivant on été trouvé,<br>"
|
text.append(tr("<b>Les fichiers de restauration suivant on été trouvé,<br>"
|
||||||
"Voulez-vous les ouvrir ?</b><br>"));
|
"Voulez-vous les ouvrir ?</b><br>"));
|
||||||
}
|
}
|
||||||
for(const KAutoSaveFile *kasf : stale_files) {
|
for(const KAutoSaveFile *kasf : stale_files)
|
||||||
|
{
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
//Remove the first character '/' before the name of the drive
|
||||||
|
text.append("<br>" + kasf->managedFile().path().remove(0,1));
|
||||||
|
#else
|
||||||
text.append("<br>" + kasf->managedFile().path());
|
text.append("<br>" + kasf->managedFile().path());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
//Open backup file
|
//Open backup file
|
||||||
|
|||||||
Reference in New Issue
Block a user