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
This commit is contained in:
xavier 2013-01-04 14:11:03 +00:00
parent 59e262b152
commit c37d401f38

View File

@ -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) {