Bug 503840 - In Kicker.RecentUsageModel, "forget" action doesn't refresh the model when "shownItems: Kicker.RecentUsageModel.OnlyDocs", so you have to restart plasmashell to see the changes
Summary: In Kicker.RecentUsageModel, "forget" action doesn't refresh the model when "s...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Application Menu (Kicker) widget (other bugs)
Version First Reported In: 6.3.4
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
: 469775 486990 493638 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-05-06 12:37 UTC by Jin Liu
Modified: 2025-12-06 01:34 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.6.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jin Liu 2025-05-06 12:37:02 UTC
SUMMARY
E.g., in https://github.com/jinliu/plasma-applet-kickon/blob/58fff6830b60c8486ea4ee9b598398d653507963/src/package/contents/ui/main.qml#L104 , triggering "forget" action on recent files removes them from the database, but the model doesn't update, so the effect is only visible when plasmashell is restarted. It works fine with OnlyApps and AppsAndDocs options.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.13.0
Qt Version: 6.9.0
Kernel Version: 6.14.4-arch1-2 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 5600H with Radeon Graphics
Memory: 15.0 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Comment 1 Nate Graham 2025-05-06 15:36:39 UTC
*** Bug 469775 has been marked as a duplicate of this bug. ***
Comment 2 cwo 2025-05-27 12:14:03 UTC
*** Bug 493638 has been marked as a duplicate of this bug. ***
Comment 3 cwo 2025-11-29 19:53:49 UTC
*** Bug 486990 has been marked as a duplicate of this bug. ***
Comment 4 cwo 2025-11-29 23:22:22 UTC
*** Bug 511714 has been marked as a duplicate of this bug. ***
Comment 5 Bug Janitor Service 2025-12-01 00:44:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-activities-stats/-/merge_requests/68
Comment 6 cwo 2025-12-04 23:11:55 UTC
Git commit b9b976a60c574d07a165090774564b00620580c6 by Christoph Wolk.
Committed on 01/12/2025 at 00:49.
Pushed by cwo into branch 'master'.

resultwatcher: send resultRemoved signal on type-restricted queries

When the forget methods on a ResultModel are called, the model instructs
the database to forget that particular resource, the ResultWatcher
notices this change in the database and sends a signal back to the model
that the resource is now gone, and the model can now remove that row and
send the correspnding signals to its consumers. But this process fails
if the query uses a type restriction - the watcher checks whether the
deleted resource also matches the type filter, and for that it needs to
ask the database what the mimetype of the resource is. But the database
doesn't know anymore, because we just instructed it to forget it. So
the forgetting happens, but the model doesn't learn about this, and will
continue to show the forgotten entry until it is refreshed for some
other reason.

Instead, we skip the check for matching type. If the type of the file
didn't match, it won't be in the cache and the model will skip further
action.

M  +4    -6    src/resultwatcher.cpp

https://invent.kde.org/plasma/plasma-activities-stats/-/commit/b9b976a60c574d07a165090774564b00620580c6