From kde-commits Sat Jan 01 13:19:38 2011 From: Andrius da Costa Ribas Date: Sat, 01 Jan 2011 13:19:38 +0000 To: kde-commits Subject: KDE/kdelibs/kfile Message-Id: <20110101131938.DBB0CAC8AE () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=129388801727960 SVN commit 1210626 by andriusr: Fixes for KUrlNavigator behavior on Windows for correcting the display of the root of non drive-C local paths. (http://reviewboard.kde.org/r/6206) M +5 -1 kurlnavigator.cpp --- trunk/KDE/kdelibs/kfile/kurlnavigator.cpp #1210625:1210626 @@ -682,7 +682,11 @@ if (text.isEmpty()) { const KUrl currentUrl = q->locationUrl(); if (currentUrl.isLocalFile()) { +#ifdef Q_OS_WIN + text = currentUrl.path().length() > 1 ? currentUrl.path().left(2) : QDir::rootPath(); +#else text = m_showFullPath ? QLatin1String("/") : i18n("Custom Path"); +#endif } else { text = currentUrl.protocol() + QLatin1Char(':'); if (!currentUrl.host().isEmpty()) { @@ -712,7 +716,7 @@ // prevent the last "/" from being stripped // or we end up with an empty path #ifdef Q_OS_WIN - pathOrUrl = pathOrUrl.length() > 2 ? pathOrUrl.left(3) : QDir::rootPath(); + pathOrUrl = pathOrUrl.length() > 1 ? pathOrUrl.left(2) : QDir::rootPath(); #else pathOrUrl = QLatin1String("/"); #endif