mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-05 10:34:13 +02:00
Merge pull request #1031 from ispyisail/fix/bugtracker-240-backup-crash
Fix bugtracker #240: crash when a recovery file cannot be opened
This commit is contained in:
@@ -2338,6 +2338,8 @@ void QETDiagramEditor::openBackupFiles(QList<KAutoSaveFile *> backup_files)
|
||||
//Create the project
|
||||
DialogWaiting::instance(this);
|
||||
|
||||
//QETProject takes ownership of file and deletes it, whether or not it opens
|
||||
const QString file_name = file->managedFile().fileName();
|
||||
QETProject *project = new QETProject(file, this);
|
||||
if (project->state() != QETProject::Ok)
|
||||
{
|
||||
@@ -2348,7 +2350,7 @@ void QETDiagramEditor::openBackupFiles(QList<KAutoSaveFile *> backup_files)
|
||||
tr("Échec de l'ouverture du projet", "message box title"),
|
||||
QString(tr(
|
||||
"Une erreur est survenue lors de l'ouverture du fichier %1.",
|
||||
"message box content")).arg(file->managedFile().fileName()));
|
||||
"message box content")).arg(file_name));
|
||||
}
|
||||
delete project;
|
||||
DialogWaiting::dropInstance();
|
||||
|
||||
Reference in New Issue
Block a user