Bug 122114 - Remove code writing ~/.recently-used file
Summary: Remove code writing ~/.recently-used file
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Arkadiy Illarionov
URL:
Whiteboard: target:6.3.0
Keywords: difficultyBeginner, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2018-12-15 00:00 UTC by Javier
Modified: 2019-04-08 15:13 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Javier 2018-12-15 00:00:35 UTC
I've found that the location for the .recently-used file is hardcoded

https://gerrit.libreoffice.org/plugins/gitiles/core/+/master/shell/source/unix/sysshell/recently_used_file.cxx#60

This should be inside of `$XDG_DATA_HOME` or at the very least be configurable through some other variable.

The rest of the LibreOffice project has been compliant with xdg standards and I don't see why this location should be hardcoded as it is.
Comment 1 Xisco Faulí 2019-01-15 13:10:06 UTC
@Stephan, any opinion here?
Comment 2 Stephan Bergmann 2019-01-15 14:06:09 UTC
From looking at recent master, ~/.recently-used appears to only be used by shell/source/unix/sysshell/recently_used_file.cxx, which is only used by shell/source/unix/sysshell/recently_used_file_handler.cxx, which in turn (through  its exported add_to_recently_used_file_list function) is only used by X11SalInstance::AddToRecentDocumentList in vcl/unx/generic/app/salinst.cxx.  The latter is the generic Unix (vclplug_gen) implementation of SalInstance::AddToRecentDocumentList (vcl/inc/salinst.hxx) introduced in <https://gerrit.libreoffice.org/plugins/gitiles/core/+/9e18c9ee07c6e8f9a62cdcb0237b183283a275ae%5E!/> "CWS-TOOLING: integrate CWS cmcfixes62", quoting which: "This function may have no effect under Unix because there is no standard API among the different desktop managers."  (Note how AquaSalInstance::AddToRecentDocumentList, GtkInstance::AddToRecentDocumentList, and WinSalInstance::AddToRecentDocumentList interface with platform-specific "recently used document" functionality, while SvpSalInstance::AddToRecentDocumentList and Qt5Instance::AddToRecentDocumentList just do nothing.)

It looks like LO itself is not reading ~/.recently-used (for anything but reading it in to write out a modified version via X11SalInstance::AddToRecentDocumentList), and I have no idea whether any other component of a Unix-like system would make use of that file.  My gut feeling is that it won't hurt to just drop all of this functionality, and make X11SalInstance::AddToRecentDocumentList do nothing.  (In which case the reference to .recently-used could probably also be dropped from sysui/desktop/apparmor/program.soffice.bin.)  Maybe it makes sense to discuss this on the libreoffice@lists.freedesktop.org mailing list.
Comment 3 Xisco Faulí 2019-03-21 13:17:47 UTC
Hi Stephan,
I guess we can turn this issue into an easyHack.
People interested in working on this issue can use libreoffice@lists.freedesktop.org for further discussion
Comment 4 Stephan Bergmann 2019-03-21 13:33:29 UTC
(In reply to Xisco Faulí from comment #3)
> I guess we can turn this issue into an easyHack.

Not before we have clarified whether the removal discussed in comment 2 is actually OK, but I have just started a discussion about that at <https://lists.freedesktop.org/archives/libreoffice/2019-March/082283.html> "~/.recently-used".
Comment 5 Xisco Faulí 2019-03-21 13:38:00 UTC
ok, removing the keywords for the time being...
Comment 6 Stephan Bergmann 2019-03-22 10:20:53 UTC
Putting back easyHack keywords; as Caolán explains at <https://lists.freedesktop.org/archives/libreoffice/2019-March/082294.html> "Re: ~/.recently-used":

"That file is the old freedesktop 'Recent File Storage Specification' recently used file 
https://specifications.freedesktop.org/recent-file-spec/recent-file-spec-0.2.html

"It was superseded by the 'Desktop Bookmark Spec' replacement https://www.freedesktop.org/wiki/Specifications/desktop-bookmark-spec/
which has appendix D stating that all recent Gnome versions use that spec

"The user of the file is intended to be the surrounding desktop
environment. There doesn't seem to be any remaining consumers for it,
so I would be happy to see it go."
Comment 7 Stephan Bergmann 2019-03-22 13:10:22 UTC
[updated summary to match what this EasyHack issue is about now; see comment 2 and comment 6]
Comment 8 Arkadiy Illarionov 2019-03-24 11:21:37 UTC
I work on this.
Comment 9 Commit Notification 2019-03-24 17:52:46 UTC
Arkadiy Illarionov committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/af19a3cc6aa352643d4f728e722945903a5556b3%5E%21

Resolves: tdf#122114 remove support for ~/.recently-used file

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.