Windows fix : When launch QElectrotech with in argument a .qet file, QElectroTech ask to user to open the restore file of the argument file.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5928 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2019-06-22 11:24:59 +00:00
parent b73d339c78
commit 21de961933
2 changed files with 4 additions and 4 deletions

View File

@@ -1793,7 +1793,7 @@ void QETApp::checkBackupFiles()
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()) { for (QETProject *project : registeredProjects().values()) {
if (kasf->managedFile() == QUrl(project->filePath())) { if (kasf->managedFile() == QUrl::fromLocalFile(project->filePath())) {
stale_files.removeOne(kasf); stale_files.removeOne(kasf);
} }
} }

View File

@@ -263,8 +263,8 @@ void QETProject::setFilePath(const QString &filepath)
delete m_backup_file; delete m_backup_file;
m_backup_file = nullptr; m_backup_file = nullptr;
} }
QUrl url_(filepath);
m_backup_file = new KAutoSaveFile(url_, this); m_backup_file = new KAutoSaveFile(QUrl::fromLocalFile(filepath), this);
if (!m_backup_file->open(QIODevice::WriteOnly)) { if (!m_backup_file->open(QIODevice::WriteOnly)) {
delete m_backup_file; delete m_backup_file;
m_backup_file = nullptr; m_backup_file = nullptr;