From c37d401f38806c5526a3107861c73727b5f004d7 Mon Sep 17 00:00:00 2001 From: xavier Date: Fri, 4 Jan 2013 14:11:03 +0000 Subject: [PATCH] Fixed a bug in QETDiagramEditor::viewForFile() which prevented the display of an error message when trying to open a non-existent file. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@1999 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/qetdiagrameditor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sources/qetdiagrameditor.cpp b/sources/qetdiagrameditor.cpp index dbaa0e231..c2bd7214a 100644 --- a/sources/qetdiagrameditor.cpp +++ b/sources/qetdiagrameditor.cpp @@ -745,6 +745,7 @@ bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interacti ).arg(filepath) ); } + return(false); } // verifie que le fichier est accessible en lecture @@ -1263,6 +1264,10 @@ ProjectView *QETDiagramEditor::viewForFile(const QString &filepath) const { if (filepath.isEmpty()) return(0); QString searched_can_file_path = QFileInfo(filepath).canonicalFilePath(); + if (searched_can_file_path.isEmpty()) { + // QFileInfo returns an empty path for non-existent files + return(0); + } foreach (ProjectView *project_view, openedProjects()) { QString project_can_file_path = QFileInfo(project_view -> project() -> filePath()).canonicalFilePath(); if (project_can_file_path == searched_can_file_path) {