From: Frank Reininghaus Date: Wed, 25 Jan 2012 20:30:57 +0000 (+0100) Subject: Handle folder names containing spaces correctly in the Folders Panel X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/c7d6f43a947c791c05726f6bf699fe0caf328d25 Handle folder names containing spaces correctly in the Folders Panel The problem was that KFileItemModel::setExpanded() used KUrl::url() to determine the names of the subfolders. This method encodes special characters, such that comparing the folder names with the unencoded URLs stored in the model fails. Using KUrl::path(), which does not encode special characters, fixes the problem. CCBUG: 291781 FIXED-IN: 4.8.1 (cherry picked from commit 80d9bfec580bf01b0ee584fc4bb46e3d59a0ba7c) --- diff --git a/src/kitemviews/kfileitemmodel.cpp b/src/kitemviews/kfileitemmodel.cpp index b1a5fec42..fb089077b 100644 --- a/src/kitemviews/kfileitemmodel.cpp +++ b/src/kitemviews/kfileitemmodel.cpp @@ -482,7 +482,7 @@ void KFileItemModel::setExpanded(const QSet& urls) return; } - const int pos = dirLister->url().url().length(); + const int pos = dirLister->url().path().length(); // Assure that each sub-path of the URLs that should be // expanded is added to m_urlsToExpand too. KDirLister @@ -493,7 +493,7 @@ void KFileItemModel::setExpanded(const QSet& urls) const KUrl& url = it1.next(); KUrl urlToExpand = dirLister->url(); - const QStringList subDirs = url.url().mid(pos).split(QDir::separator()); + const QStringList subDirs = url.path().mid(pos).split(QDir::separator()); for (int i = 0; i < subDirs.count(); ++i) { urlToExpand.addPath(subDirs.at(i)); m_urlsToExpand.insert(urlToExpand);