[qet] [1999] Fixed a bug in QETDiagramEditor::viewForFile() which prevented the display of an error message when trying to open a non-existent file . |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
- To: qet@xxxxxxxxxxxxxxxxxxx
- Subject: [qet] [1999] Fixed a bug in QETDiagramEditor::viewForFile() which prevented the display of an error message when trying to open a non-existent file .
- From: subversion@xxxxxxxxxxxxx
- Date: Fri, 04 Jan 2013 15:11:03 +0100
Revision: 1999
Author: xavier
Date: 2013-01-04 15:11:03 +0100 (Fri, 04 Jan 2013)
Log Message:
-----------
Fixed a bug in QETDiagramEditor::viewForFile() which prevented the display of an error message when trying to open a non-existent file.
Modified Paths:
--------------
trunk/sources/qetdiagrameditor.cpp
Modified: trunk/sources/qetdiagrameditor.cpp
===================================================================
--- trunk/sources/qetdiagrameditor.cpp 2013-01-03 21:53:26 UTC (rev 1998)
+++ trunk/sources/qetdiagrameditor.cpp 2013-01-04 14:11:03 UTC (rev 1999)
@@ -745,6 +745,7 @@
).arg(filepath)
);
}
+ return(false);
}
// verifie que le fichier est accessible en lecture
@@ -1263,6 +1264,10 @@
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) {