Summary: | The "Empty Trash" action is disabled when files have been moved to the trash by a non-KDE application | ||
---|---|---|---|
Product: | [Applications] dolphin | Reporter: | Alex <invnd> |
Component: | panels: places | Assignee: | Peter Penz <peter.penz19> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | frank78ac |
Priority: | NOR | Keywords: | investigated |
Version: | 2.0 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kde-baseapps/0aa9628b381befba92bc6a8cfccd6d35cfdee094 | Version Fixed In: | 4.9.0 |
Sentry Crash Report: |
Description
Alex
2012-02-08 16:22:00 UTC
Thanks for the bug report! I can reproduce this with Zim 0.56 and KDE 4.8.3. The problem is that KFilePlacesView (which provides the contents of the Places Panel in KDE <= 4.8.x) reads KDE's "trashrc" file and checks if it contains the line "Empty=true" to decide if the action should be enabled. This file does not get updated when using a non-KDE application to move items to the trash, which is why this bug occurs. @Peter: I've noticed that in 4.9, PlacesItem uses a dir lister to determine if the trash is empty and then updates the icon. Maybe we should use the same approach to enable/disable the action in the context menu. One could copy&paste the code from PlacesItem to PlacesPanel, but that's a bit ugly because of code duplication. Maybe a better approach is to move the code to PlacesItemModel and notify both the "trash"-PlacesItem and the PlacesPanel via signals about the state of the trash. Do you agree, Peter? If yes, I could try to come up with a patch. Thanks Frank, but I'd suggest to instead of moving the KDirLister stuff to KFilePlacesModel to just let the PlacesPanel check the icon of the trash-item before opening the menu. Git commit 0aa9628b381befba92bc6a8cfccd6d35cfdee094 by Frank Reininghaus. Committed on 21/05/2012 at 23:15. Pushed by freininghaus into branch 'master'. Enable the "Empty Trash" action if items are deleted by non-KDE apps To achieve this, the Places Panel context menu now checks the icon of the "Trash" item (which is updated by a dir lister that watches the state of the trash), rather then reading a config file which is only used by KDE applications. FIXED-IN: 4.9.0 M +1 -3 dolphin/src/panels/places/placespanel.cpp http://commits.kde.org/kde-baseapps/0aa9628b381befba92bc6a8cfccd6d35cfdee094 Thanks for the hint Peter, that was indeed much easier :-) |