Fix clearing recent usage history

Authored by heikobecker on May 1 2017, 11:57 AM.



The old method is gone with Plasma 4. Instead go through
kactivitymanagerd. Also, instead of checking at build time for
Q_WS_X11 (gone with Qt4), look at dbus if kactivitymanagerd's
service is registered to determine if the action should be

Test Plan

Checked with kactivitymanagerd available/unavailable on dbus.
Successfully removed the history.

Diff Detail

R364 Sweeper
No Linters Available
No Unit Test Coverage
heikobecker created this revision.May 1 2017, 11:57 AM

Question about the "Recent Documents" entries


What is the scope of this action then? The description seems to overlap with the new "clean applications and documents" (and apparently does not work)

heikobecker added inline comments.May 3 2017, 10:38 AM

Yeah, that is indeed confusing.

It clears out ~/.local/share/RecentDocuments (which works here), but apparently isn't used by any Plasma launcher AFAICT, which all seem to use KActitvities.

Websites I open via links from KDE Applications in Firefox appear in ../RecentDocuments for example, but don't appear under Recent Documents in the launchers.

ltoscano added a subscriber: ivan.May 5 2017, 6:06 PM

@ivan , can you help here? Do you know if Recentdocuments is still relevant somewhere, or was totally replaced by the interface from kactivities, or is still in transition?

mart added a subscriber: mart.Jun 26 2017, 10:50 AM
mart added inline comments.

it seems the method is called ClearRecentApplicationAction, tough this would nuke all usage stats on every kind of documents as well.. is this the intended behavior?

ivan added inline comments.Jul 2 2017, 11:05 AM

It is not advisable to use KAMD d-bus directly. It is not officially a stable API. You should use the KAStats library instead.


You should probably clear both the ~/.local/share/RecentDocuments and the statistics from KAMD.

heikobecker updated this revision to Diff 17713.Aug 4 2017, 2:55 PM

Used KActivitiesStats as suggested by @ivan

heikobecker updated this revision to Diff 17714.Aug 4 2017, 2:58 PM

Removed a string change which wasn't necessary anymore

heikobecker marked 4 inline comments as done.Aug 4 2017, 3:00 PM

Sorry for taking so long on this, but I was busy with other things.

aacid added a subscriber: aacid.Aug 14 2017, 10:22 PM
ltoscano accepted this revision.Aug 24 2017, 11:21 PM

Confirmed; recent applications are cleaned from the application launcher with this patch.

(unrelated, but before I forget: the cleanup of the clipboard works only with klipper, but not with the now more widespread plasma applet; maybe it should be enabled only if the klipper dbus interface is found?).

This revision is now accepted and ready to land.Aug 24 2017, 11:21 PM
This revision was automatically updated to reflect the committed changes.