Summary: | Folder View pointed at Trash doesn't update the context menu properly | ||
---|---|---|---|
Product: | [Unmaintained] plasma4 | Reporter: | Marcus Harrison <marcus> |
Component: | widget-folderview | Assignee: | Plasma Bugs List <plasma-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | dave.greengas, thomasdn |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Unlisted Binaries | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Screenshot showing reproduction of the bug |
Description
Marcus Harrison
2010-12-09 18:16:39 UTC
Created attachment 54366 [details]
Screenshot showing reproduction of the bug
I can confirm that following the steps to reproduce the bug in KDE 4.5.4. Please see attached screenshot. My steps were as follows:
1) Drag empty Trash to Panel from within Dolphin and create folder view
2) Add something to the trash observing that the icon on the panel changes as desired
3) Right-click on the trash icon in the panel and see that emptying the trash is not possible
I was just browsing through websvn.kde.org to see if I could quickly find why this could be occurring. This may be completely wrong, but it could at least be a start. In kdebase/apps/plasma/applets/folderview/folderview.cpp, I noticed that the method FolderView::contextualActions checks to see if the url protocol is trash before adding the empty_trash action, but does not check to see if it should be enabled or not. The latter is checked only once in createActions. if (m_url.protocol() == "trash") { actions.append(m_actionCollection.action("empty_trash")); } Perhaps adding this inside the if would help KConfig trashConfig("trashrc", KConfig::SimpleConfig); m_actionCollection.action("empty_trash")->setEnabled(!trashConfig.group("Status").readEntry("Empty", true)); just before appending it to the context menu. *** Bug 273079 has been marked as a duplicate of this bug. *** Git commit fed2ad991153672deecfc2df7c51bb34a58761c5 by Gregor Tätzner. Committed on 03/12/2011 at 18:33. Pushed by gregort into branch 'master'. Folder View pointed at Trash doesn't update the context menu properly enable empty_trash action in contextualActions when the url is pointing to trash:/. contextualActions checks to see if the url protocol is trash before adding the empty_trash action, but does not check to see if it should be enabled or not. BUG: 259356 REVIEW: 103282 M +3 -0 plasma/applets/folderview/folderview.cpp http://commits.kde.org/kde-baseapps/fed2ad991153672deecfc2df7c51bb34a58761c5 |