Bug 470405 - recently-used.xbel is keep populating even with UseRecent=false
Summary: recently-used.xbel is keep populating even with UseRecent=false
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.106.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-29 10:23 UTC by serfreeman1337
Modified: 2024-03-07 05:26 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description serfreeman1337 2023-05-29 10:23:45 UTC
File ~/.local/share/recently-used.xbel is keep populating even with UseRecent=false in RecentDocuments config group.

I think addToXbel should be after this conditional check:
https://invent.kde.org/frameworks/kio/-/blob/master/src/core/krecentdocument.cpp#L509
Comment 1 Nate Graham 2023-06-05 03:51:19 UTC
Sounds good! Wanna do it? :)
Comment 2 Méven Car 2023-06-23 08:25:34 UTC
This file is not populated only by KDE software.

What was/were the applications that added historic data ?

You will see our implementation does enforce this setting.
https://invent.kde.org/frameworks/kio/-/blob/master/src/core/krecentdocument.cpp#L526

This could be considered a bug about this comment in commit https://invent.kde.org/frameworks/kio/-/commit/16e8d3151c31dd3695f4da2aa3536eb5cd156edc:

> The constraints are enforced at add time, meaning data added by other
libraries (GTK) will not respect those. We still need a daemon to
enforce this. This could be the activitymanagerd daemon, that already monitors the xbel file.
Comment 3 serfreeman1337 2023-06-23 09:58:17 UTC
> You will see our implementation does enforce this setting.
It wasn't before mentioned commit was merged, where addToXbel was executing before any checks:
https://invent.kde.org/frameworks/kio/-/commit/16e8d3151c31dd3695f4da2aa3536eb5cd156edc#05012c7c5abbd196d468a9c8ca973dc68c17c082_495_519

I even see that there was an attempt to backport it kf5, which was reverted:
https://invent.kde.org/frameworks/kio/-/commit/90357ac0394030a607d69a26dca5d6a0a64b42b0#05012c7c5abbd196d468a9c8ca973dc68c17c082_497_483

With KF 5.107.0 opening any file in Dolpin or saving screenshot with Spectacle will result in write to recently-used.xbel.
Comment 4 Méven Car 2023-06-23 10:00:43 UTC
All right, so this a simple to fix KF5bug.