Bug 501802 - File activity in KDE applications is recorded in recently-used.xbel, even if System Settings > Recent Files > Remember open documents is set to "Do not remember"
Summary: File activity in KDE applications is recorded in recently-used.xbel, even if ...
Status: CONFIRMED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 6.6.0
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-03-20 18:50 UTC by Josh
Modified: 2026-08-11 10:54 UTC (History)
8 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Josh 2025-03-20 18:50:42 UTC
SUMMARY
I have disabled recent files but Dolphin still creates a recently-used.xbel file.

STEPS TO REPRODUCE

1. In System Settings > Recent Files, set "Remember opened documents" to "Do not remember".

2. Move the existing recently-used.xbel file:
mv ~/.local/share/recently-used.xbel ~/.local/share/recently-used.xbel.old

3. Open Dolphin and launch a file. (I opened a text file in Kate to be sure I wasn't launching a non-QT app).

4. Verify that a file has been created:
ls -al ~/.local/share/recently-used.xbel

5. Open the file in Kate to show that it contains a list of recently opened files:
kate ~/.local/share/recently-used.xbel


OBSERVED RESULT
~/.local/share/recently-used.xbel is created when Recent Files have been set to "Do not remember".


EXPECTED RESULT
~/.local/share/recently-used.xbel should not be created when Recent Files have been set to "Do not remember".


SOFTWARE/OS VERSIONS
Operating System: Kubuntu 24.10
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.6.2
Kernel Version: 6.11.0-19-generic (64-bit)
Graphics Platform: Wayland
Comment 1 Josh 2025-03-20 18:55:29 UTC
Additionally, "~/.local/share/RecentDocuments/" remains empty as expected when opening files in Dolphin and Recent Files are disabled.
Comment 2 John Kizer 2025-04-07 19:18:03 UTC
Hi - I can reproduce this on Fedora KDE 41. This seems to occur even when opening a file directly in Kate, so I don't think it's a Dolphin issue strictly speaking - I'm not 100% sure which product this belongs in, but I think it would fall under Frameworks?
Comment 3 Adam Fontenot 2025-05-12 14:18:43 UTC
I noticed this too in my Bug 470026. Also, for me, using the "Clear History" option "Forget everything" doesn't delete recently-used.xbel, or even remove entries from the file.
Comment 4 a.kde 2026-06-16 19:39:44 UTC
This bug is still present as of current kio master (d913ed09) and plasma-desktop master (691b1187).

The root cause is that kio's KRecentDocument needs an (undocumented?) setting "[RecentDocuments] UseRecent=false" to stop writing to recently-used.xbel (see: https://invent.kde.org/frameworks/kio/-/blob/d913ed0900a5304928fc5a32c40f00e01f3f8ce4/src/core/krecentdocument.cpp#L512). But kcm_recentFiles, with "System Settings -> Recent Files -> Remember opened documents -> Do not remember" selected, does not set UseRecent=false at all.

(It only changes settings in kactivitymanagerd-pluginsrc (see: https://invent.kde.org/plasma/plasma-desktop/-/blob/691b1187c82155100a56f00c9f57eddb914479b8/kcms/recentFiles/kcm_recentFiles.cpp#L165 and https://invent.kde.org/plasma/plasma-desktop/-/blob/691b1187c82155100a56f00c9f57eddb914479b8/kcms/recentFiles/kactivitymanagerd_plugins_settings.kcfg#L6). Unchecking "System Settings -> Activities -> Default -> While on this activity, allow -> Tracking file and app use" doesn't help either.)

I also believe that since Plasma already sets various options for GTK, "Do not remember" should also set either the GTK3/GTK4 setting "gtk-recent-files-enabled=false" and the dconf setting "org.gnome.desktop.privacy remember-recent-files false" (the latter works only on Wayland, see: https://gitlab.gnome.org/GNOME/gtk/-/blob/668e216846a42ca29f3c258384ed03a36875c62a/gdk/wayland/gdksettings-wayland.c#L286 and https://gitlab.gnome.org/GNOME/gtk/-/blob/668e216846a42ca29f3c258384ed03a36875c62a/gtk/gtkrecentmanager.c#L457 and https://gitlab.gnome.org/GNOME/glib/-/blob/303b0dff4ee52e1311c3a518fe96d0e7e55e1328/glib/gbookmarkfile.c#L2067).

---

Since this bug is not very likely to get much attention, if anyone is interested in a comprehensive workaround until it's fixed, you need to:

1. run "kwriteconfig6 --group RecentDocuments --key UseRecent false"
(Explanation: this writes to kdeglobals and stops KRecentDocument writing to recently-used.xbel - see the git link to kio/src/core/krecentdocument.cpp above).

Remember that recently-used.xbel is not just a KDE thing, it's a freedesktop spec (see: https://www.freedesktop.org/wiki/Specifications/desktop-bookmark-spec/), so you also need to stop it for GTK apps:

2. on Wayland, run "gsettings set org.gnome.desktop.privacy remember-recent-files false"
(Explanation: this is enough to stop writing to recently-used.xbel for most Wayland GTK3 and GTK4 apps, see the gtk and glib git links above). If you're still using X apps, I haven't tested it, but setting the GTK option "gtk-recent-files-enabled=false" should work - though be careful as KDE writes to many gtk configs.

Note that the above may not be enough to cover all apps attempting to write to recently-used.xbel. For good measure, you can:

3. run "rm -f ~/.local/share/recently-used.xbel && mkdir ~/.local/share/recently-used.xbel{,.lock} && touch ~/.local/share/recently-used.xbel{,.lock}/recently-used".
(Explanation: libs using this file will first write the current contents and new data to a recently-used.xbel.XXXXXX mkstemp() file and then rename, to make the change atomic. kio additionally uses a lock in the form of a "recently-used.xbel.lock"" file and does not attempt to write if it can't take that lock. See e.g. https://invent.kde.org/frameworks/kio/-/blob/d913ed0900a5304928fc5a32c40f00e01f3f8ce4/src/core/krecentdocument.cpp#L179 and https://gitlab.gnome.org/GNOME/glib/-/blob/303b0dff4ee52e1311c3a518fe96d0e7e55e1328/glib/gfileutils.c#L1368).

Tl;dr: these three steps should stop writes to recently-used.xbel, but there's no guarantee at all that some app won't try to write to it - note that even with step #3 an app may still leak data to disk, writing to a "recently-used.xbel.XXXXXX" tempfile.