Version: 2.0 (using Devel) OS: Linux When I open a folder, which has a folder with a "space" character in its path, the folderview on the left does not open/select/scrollto that folder. for example a path like /xxx/xx/xxx xxx/xxx I am not sure if spaces are the problem, but this is the only differences I notice between working and not-working cases. Reproducible: Always Steps to Reproduce: see above Actual Results: see above Expected Results: see above OS: Linux (x86_64) release 2.6.37.1-1.2-desktop Compiler: gcc
Thanks for the bug report! I can confirm the problem.
The problem is in void KFileItemModel::setExpanded(const QSet<KUrl>& urls). This function contains the line const QStringList subDirs = url.url().mid(pos).split(QDir::separator()); to determine a chain of sub folders leading to the url to be expanded. However, KUrl::url() returns a QString where special characters like spaces are encoded -> "xxx xxx" becomes "xxx%2520xxx". The expansion algorithm in KFileItemModel::slotCompleted() then fails to find the encoded url in the model. So we should transform the KUrl to a QString without encoding it. I'll have a look at that later.
*** Bug 290721 has been marked as a duplicate of this bug. ***
Git commit 80d9bfec580bf01b0ee584fc4bb46e3d59a0ba7c by Frank Reininghaus. Committed on 25/01/2012 at 21:30. Pushed by freininghaus into branch 'KDE/4.8'. 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. FIXED-IN: 4.8.1 M +2 -2 dolphin/src/kitemviews/kfileitemmodel.cpp http://commits.kde.org/kde-baseapps/80d9bfec580bf01b0ee584fc4bb46e3d59a0ba7c
Git commit e6e8e6fdc1a4d50364b9479b1de7d8fc3b5c0c64 by Frank Reininghaus. Committed on 25/01/2012 at 21:30. Pushed by freininghaus into branch 'master'. 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. FIXED-IN: 4.8.1 (cherry picked from commit 80d9bfec580bf01b0ee584fc4bb46e3d59a0ba7c) M +2 -2 dolphin/src/kitemviews/kfileitemmodel.cpp http://commits.kde.org/kde-baseapps/e6e8e6fdc1a4d50364b9479b1de7d8fc3b5c0c64