RecentDocuments Runner: Cleanup and formatting
AbandonedPublic

Authored by alex on Apr 3 2020, 6:43 PM.

Details

Summary
  • Instead of early returning in the match method if the list of recent documents is empty the matching is suspended.
  • The imports have been cleaned up, redundant Q_UNUSED macros have been removed and the formatting has been changed.
  • Instead of getting the action using the id, all the actions are returned (in this case just the one that is set in the constructor).
  • The unnecessary comparison of the action has been removed and the replace method call uses a more performant overload.
Test Plan

Should compile and show the recent documents.
To test the suspendMatching: Clear the ~/.local/share/RecentDocuments folder, restart krunner.
There should be no results. Then open a file in dolphin and the file shows up as a query result in krunner.

Diff Detail

Repository
R120 Plasma Workspace
Branch
recentdocuments_cleanup (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 24691
Build 24709: arc lint + arc unit
alex created this revision.Apr 3 2020, 6:43 PM
Restricted Application added a project: Plasma. Β· View Herald TranscriptApr 3 2020, 6:43 PM
Restricted Application added a subscriber: plasma-devel. Β· View Herald Transcript
alex requested review of this revision.Apr 3 2020, 6:43 PM
alex updated this revision to Diff 79244.Apr 3 2020, 6:46 PM

Change import

meven added a comment.Apr 4 2020, 9:47 AM

Regarding the recentdocument krunner, I have a patch to make it rely on kactivity data : D26111. It has been waiting for review of a while.
This patch will introduce a lot of conflict, but I am ok either way, if this one get merged first.

Just a small nitpick on may part.

runners/recentdocuments/recentdocuments.cpp
107 β†—(On Diff #79244)

You can replace with KShell::tildeCollapse for this if.

alex added a comment.Apr 4 2020, 11:51 AM

I didn't knew this patch existed and that it introduces coneptual changes.
This is just a patch with smaller improvements/cleanup. Because of this I suggest waiting for your patch to be merged and than rebasing πŸ˜ƒ.

alex abandoned this revision.Jun 1 2020, 6:06 AM

Will continue on gitlab

meven added a comment.Jun 2 2020, 10:13 AM

Well @alex https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/31 was merged, so if you are still up to do it, now is a good time to rebase your changes.