From fa46fa236b5f4a9a5677da2e7464a6b9f8b7b5f3 Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Wed, 12 May 2010 14:41:49 +0200 Subject: make QFileSystemModel distinguish C: from C:\ Since QFileSystemModel just uses a C: to represent C:\ for esthetics, we now need to append a slash to make sure we do not accidently point to the current working directory on C:\. Reviewed-by: Joao Task-number: QTBUG-8241 --- src/gui/dialogs/qfilesystemmodel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/dialogs/qfilesystemmodel.cpp b/src/gui/dialogs/qfilesystemmodel.cpp index 8a6190f..e5a8445 100644 --- a/src/gui/dialogs/qfilesystemmodel.cpp +++ b/src/gui/dialogs/qfilesystemmodel.cpp @@ -1290,6 +1290,10 @@ QString QFileSystemModelPrivate::filePath(const QModelIndex &index) const if ((fullPath.length() > 2) && fullPath[0] == QLatin1Char('/') && fullPath[1] == QLatin1Char('/')) fullPath = fullPath.mid(1); #endif +#if defined(Q_OS_WIN) + if (fullPath.length() == 2 && fullPath.endsWith(QLatin1Char(':'))) + fullPath.append(QLatin1Char('/')); +#endif return fullPath; } -- cgit v0.12