Bug 420504 - "Open Recent": list _all_ files not just from file dialog
Summary: "Open Recent": list _all_ files not just from file dialog
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 19.12.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-24 10:10 UTC by arne anka
Modified: 2023-04-13 19:46 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 20.08.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description arne anka 2020-04-24 10:10:44 UTC
SUMMARY
Files opened from a shell (kate.foo.txt) do not appear in "Open Recent".
There's only files opened from inside Kate via file dialog.

Sicne I hardly ever open files that way, but usually frrom a shell, those files are never in that list.

STEPS TO REPRODUCE
1. in a shell kate foo.txt
2. close kate
3. reopen kate
4. File -> Open Recent: foo.txt is missing

OBSERVED RESULT
file not listed

EXPECTED RESULT
file listed

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian/Sid
(available in About System)
KDE Plasma Version: 5.17.5
KDE Frameworks Version: 5.62.0
Qt Version: 5.12.5

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2020-04-24 18:08:21 UTC
Yeah, Kate, could add such documents to the global list of recently opened documents. I do the same thing FWIW.
Comment 2 Christoph Cullmann 2020-04-26 14:46:59 UTC
Hmm, I tried that with a current Kate version:

kate xxxx.txt
close
reopen
=> xxxx.txt is in open recent

(current kate 20.04 version)

Nate, can you reproduce the issue?
Comment 3 Méven Car 2020-04-27 13:20:08 UTC
This is to be expected.

Kate needs to call KActivity API to notify opening files from command line (this is done through KFileWidgets/KDocumentRecent when using open/save dialogs).
Look at gwenview code as an example : https://github.com/KDE/gwenview/commit/2a5ffe66e1def52f5044aebcf4b6e46392f4f2cc
https://github.com/KDE/gwenview/commit/a00eecc78507f48843f719f32e80ae8805a34c15
Comment 4 Christoph Cullmann 2020-04-27 13:26:19 UTC
Are we talking about different things?

I thought this request was about the "File -> Open Recent" menu in the application.

But this is about some global one?
Comment 5 Méven Car 2020-04-30 13:11:40 UTC
Yes you are write those are two different things. I missed this was about kate own open recent menu.

You would need to use KRecentDocument to save it to the Open Recent menu (what KFileWidgets uses), when opening files from the commandline.

Once this is done, Activitymanagerd will it pickup and this history will be available whenever recent files are fetched from KActivity (Kickoff, recentlyused:/, soon krunner, taskmanager).
Comment 6 Christoph Cullmann 2020-06-12 19:00:31 UTC
Git commit c4b20b89954560a8abf1f49024d74a8559128851 by Christoph Cullmann.
Committed on 12/06/2020 at 19:02.
Pushed by cullmann into branch 'master'.

register files not only at recently opened files menu but globally, too

M  +15   -0    kate/katemainwindow.cpp
M  +5    -4    kate/katemainwindow.h
M  +4    -12   kate/kateviewmanager.cpp

https://invent.kde.org/utilities/kate/commit/c4b20b89954560a8abf1f49024d74a8559128851