]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Handle folder names containing spaces correctly in the Folders Panel
authorFrank Reininghaus <frank78ac@googlemail.com>
Wed, 25 Jan 2012 20:30:57 +0000 (21:30 +0100)
committerFrank Reininghaus <frank78ac@googlemail.com>
Wed, 25 Jan 2012 20:32:49 +0000 (21:32 +0100)
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

src/kitemviews/kfileitemmodel.cpp

index b1a5fec422999f505754d0c1c5e67df89e36a293..fb089077b3df31f794bb774cb99c61c72bc35914 100644 (file)
@@ -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);