Summary: | Problem with tree view when using programs:/ protocol | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | André Marcelo Alvarenga <alvarenga> |
Component: | general | Assignee: | Dolphin Bug Assignee <dolphin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | emmanuelpescosta099, faure |
Priority: | NOR | Keywords: | investigated |
Version: | 2.2 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kde-runtime/3dafdf356b549c9f9cbedcebb996486be8b56ce9 | Version Fixed In: | 4.11 |
Sentry Crash Report: | |||
Attachments: |
Screenshot
Debugging patch New screenshot |
Description
André Marcelo Alvarenga
2013-05-27 02:09:34 UTC
Created attachment 80099 [details]
Screenshot
Hello André, thanks for the bug report! I cannot reproduce this bug with Dolphin 2.2, maybe because of the different language settings (English in my case). This bug should be fixed in Dolphin 2.3 / KDE 4.11. See commit https://projects.kde.org/projects/kde/applications/kde-baseapps/repository/revisions/8008bc233d8447794df6f4cdc8c3f0ee7e8ac628 Do you really have Dolphin 2.2? Not Dolphin from git? Because I can reproduce this bug with the git version of Dolphin. Very strange .... Created attachment 80101 [details]
Debugging patch
The debugging patch yields the following output when opening 'programs:' and then expanding 'Applications':
Items added in directory KUrl("programs://") :
([KFileItem forKUrl("programs:/Applications/") ] , [KFileItem for KUrl("programs:/Office/") ] , [KFileItem for KUrl("programs:/Utilities/") ] , [KFileItem for KUrl("programs:/Education/") ] , [KFileItem for KUrl("programs:/Development/") ] , [KFileItem for KUrl("programs:/Graphics/") ] , [KFileItem for KUrl("programs:/Internet/") ] , [KFileItem for KUrl("programs:/Multimedia/") ] , [KFileItem for KUrl("programs:/Science/") ] , [KFileItem for KUrl("programs:/Games/") ] , [KFileItem for KUrl("programs:/System/") ] , [KFileItem for KUrl("programs:/kfind") ] , [KFileItem for KUrl("programs:/systemsettings") ] )
Items added in directory KUrl("programs:/Applications") :
([KFileItem forKUrl("programs:/Applications/kseg") ] , [KFileItem for KUrl("programs:/Applications/kde-ksimus") ] , [KFileItem for KUrl("programs:/Applications/xaos") ] , [KFileItem for KUrl("programs:/Applications/xmgrace") ] , [KFileItem for KUrl("programs:/Applications/xmoontool") ] , [KFileItem for KUrl("programs:/Applications/xyscan") ] , [KFileItem for KUrl("programs:/Applications/zim") ] )
Note how the KFileItem for 'Applications/' is added *with* trailing slash, but the child items that appear when expanding are supposed to have 'Applications', *without* trailing slash, as their parent folder. This is why looking up the parent fails in KFileItemModel.
Now we could of course add hacks to Dolphin to always remove the trailing slash everywhere, but I do not think that this is the right approach to fix this. A better place for a fix might be
kde-runtime.git/kioslave/applications/kio_applications.cpp
But it seems that there is no bugzilla component for this code that provides access to 'programs:'
@Frank: Found the same problem, but you are faster with writting the comment. ;) Are there other kio slaves where the trailing space problem appears? Created attachment 80102 [details] New screenshot > Do you really have Dolphin 2.2? > > Not Dolphin from git? Because I can reproduce this bug with the git version of Dolphin. Very strange .... This screenshot is the 2.2.60 version (Project Neon) In 4.10.2 version, I can see a similar problem (see new screenshot). Subitems are above. settings:/ protocol works fine for me. Thanks for your help. Just one line is needed in kio_applications.cpp to fix this bug. Add "dirUrl.adjustPath(KUrl::RemoveTrailingSlash);" after "dirUrl.setPath('/' + relPath);" in "void ApplicationsProtocol::listDir(const KUrl& url)". Thanks for the 2. screenshot. It shows the bug which is fixed in Dolphin 2.3 (Comment #2) ;) (In reply to comment #5) > Are there other kio slaves where the trailing space problem appears? I'm not aware of any other kioslaves that have this "trailing slash" behaviour. If there are any others, people will certainly find out during the beta cycle and let us know. (In reply to comment #8) > Just one line is needed in kio_applications.cpp to fix this bug. > > Add "dirUrl.adjustPath(KUrl::RemoveTrailingSlash);" after > "dirUrl.setPath('/' + relPath);" in "void > ApplicationsProtocol::listDir(const KUrl& url)". Great, thanks for looking into it! I'll add David to CC (he is the last one who touched the file, I think). In case he misses the notification, you might want to file a review request for kde-runtime and add him as reviewer. Git commit 3dafdf356b549c9f9cbedcebb996486be8b56ce9 by Emmanuel Pescosta. Committed on 10/06/2013 at 10:30. Pushed by emmanuelp into branch 'master'. Fix Bug 320335 - Problem with tree view when using programs:/ protocol Create directories without trailing slashes, like every other kio slave does. REVIEW: 110924 FIXED-IN: 4.11 M +1 -0 kioslave/applications/kio_applications.cpp http://commits.kde.org/kde-runtime/3dafdf356b549c9f9cbedcebb996486be8b56ce9 |