From 065c1e4fd2029dbe7485a884d3cc2d06584a29bb Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Fri, 15 Oct 2010 14:12:10 +0200 Subject: make QFileDialog completer return proper dirnames in root This bug was introduced with fa46fa236b5f4a9a5677da2e7464a6b9f8b7b5f3 Reviewed-by: Joao --- src/gui/dialogs/qfiledialog.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/dialogs/qfiledialog.cpp b/src/gui/dialogs/qfiledialog.cpp index 624610b..1b9d127 100644 --- a/src/gui/dialogs/qfiledialog.cpp +++ b/src/gui/dialogs/qfiledialog.cpp @@ -3261,7 +3261,10 @@ QString QFSCompleter::pathFromIndex(const QModelIndex &index) const if (currentLocation == QDir::separator()) return path.mid(currentLocation.length()); #endif - return path.mid(currentLocation.length() + 1); + if (currentLocation.endsWith('/')) + return path.mid(currentLocation.length()); + else + return path.mid(currentLocation.length()+1); } return index.data(QFileSystemModel::FilePathRole).toString(); } -- cgit v0.12