Version: 2.0 (using KDE 4.8.0)
Zim deletes its notes to recycle bin. But I can't clear recycle bin in dolphin from Zim's files.
Steps to Reproduce:
Start Zim 0.54. Create a new note and add some text there. Then right click on the note in the list of all notes (left side of Zim window). Select to delete this note. It's gone to recycle bin. Now start Dolphin and right click on the recycle bin.
The "clear recycle bin" function is not available. But the recycle bin has the file, the icon shows that.
The "clear recycle bin" function should be available.
It doesn't happen with other files, deleted with dolphin. To me it was only Zim v0.54.
And if I add some files to recycle bin and clear it - all files are gone along with Zim's deleted note.
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.
M +1 -3 dolphin/src/panels/places/placespanel.cpp
Thanks for the hint Peter, that was indeed much easier :-)