┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kfileitemmodel.cpp
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2012-01-25 21:30:57 +0100
committerFrank Reininghaus <[email protected]>2012-01-25 21:32:49 +0100
commit2a812eaf7d733699c3d5e61497ca34ac2c2e2840 (patch)
tree0dd68bd2b14ee7891b540fd57baab49ce51fc43f /src/kitemviews/kfileitemmodel.cpp
parent3a84f2223b71dba0c6a2934b8c7cf443306f5a3b (diff)
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. BUG: 291781 FIXED-IN: 4.8.1
Diffstat (limited to 'src/kitemviews/kfileitemmodel.cpp')
-rw-r--r--src/kitemviews/kfileitemmodel.cpp4
1 files changed, 2 insertions, 2 deletions
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<KUrl>& 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<KUrl>& 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);