summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@nokia.com>2010-10-15 12:12:10 (GMT)
committerZeno Albisser <zeno.albisser@nokia.com>2010-10-20 09:31:36 (GMT)
commit065c1e4fd2029dbe7485a884d3cc2d06584a29bb (patch)
treece6942614b7cc3b0ca1a44b44959c1c101ccbe1f
parent91e5c91cde03d36cf85e31de1f66d6552e621ccd (diff)
downloadQt-065c1e4fd2029dbe7485a884d3cc2d06584a29bb.zip
Qt-065c1e4fd2029dbe7485a884d3cc2d06584a29bb.tar.gz
Qt-065c1e4fd2029dbe7485a884d3cc2d06584a29bb.tar.bz2
make QFileDialog completer return proper dirnames in root
This bug was introduced with fa46fa236b5f4a9a5677da2e7464a6b9f8b7b5f3 Reviewed-by: Joao
-rw-r--r--src/gui/dialogs/qfiledialog.cpp5
1 files changed, 4 insertions, 1 deletions
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();
}