# Backport revision 948028 from kdelibs 4.3.0 # ------------------------------------------------------------------------ # r948028 | rkcosta | 2009-04-01 22:07:12 -0300 (Qua, 01 Abr 2009) | 4 lines # # Strip duplicated path separators in KUrlNavigator. # # BUG: 188417 # # ------------------------------------------------------------------------ --- kfile/kurlnavigator.cpp.orig 2009-04-06 10:36:51.000000000 -0300 +++ kfile/kurlnavigator.cpp 2009-04-06 10:40:05.000000000 -0300 @@ -953,22 +953,24 @@ return; } - QString urlStr(KUrlCompletion::replacedPath(newUrl.pathOrUrl(), true, true)); - + KUrl url = newUrl; + url.cleanPath(); + + QString urlStr = KUrlCompletion::replacedPath(url.pathOrUrl(), true, true); if ((urlStr.length() > 0) && (urlStr.at(0) == '~')) { // replace '~' by the home directory urlStr.remove(0, 1); urlStr.insert(0, QDir::homePath()); } - if ((newUrl.protocol() == "tar") || (newUrl.protocol() == "zip")) { + if ((url.protocol() == "tar") || (url.protocol() == "zip")) { // The URL represents a tar- or zip-file. Check whether // the URL is really part of the tar- or zip-file, otherwise // replace it by the local path again. - bool insideCompressedPath = d->isCompressedPath(newUrl); + bool insideCompressedPath = d->isCompressedPath(url); if (!insideCompressedPath) { - KUrl prevUrl = newUrl; - KUrl parentUrl = newUrl.upUrl(); + KUrl prevUrl = url; + KUrl parentUrl = url.upUrl(); while (parentUrl != prevUrl) { if (d->isCompressedPath(parentUrl)) { insideCompressedPath = true; @@ -981,7 +983,7 @@ if (!insideCompressedPath) { // drop the tar: or zip: protocol since we are not // inside the compressed path anymore - urlStr = newUrl.path(); + urlStr = url.path(); } }