I don't know where to put this bug. It seems more related to the way plasma restores last session but it only happens to kate.
I use kate every now and then to edit small files and it seems like every time I do it inserts an empty kate session into the session restore thing. This builds up after a while so currently I have about 80 kate sessions starting up.
Reproducible: Couldn't Reproduce
This has been happening to me even after reinstalling kubuntu. I'm currently using the neon packages.
The session restore thing seems a bit wonky in general, If I close everything and reboot it still opens up things I closed before rebooting. For me it mostly gets in the way so I should disable it but I figured I should report this.
Can confirm in the latest Kate in 17.08.x; I've seen this too. Haven't been able to come up with a reproducible test case, though.
I can also confirm that with Kubuntu 17.04 (KDE Plasma 5.9.5 KDE Frameworks 5.31.0). Reproducibility is always. Just open some files in Kate (in one instance, multiple tabs), shutdown the computer, restart it and Kate will reopen a lot of empty sessions (Interestingly with a lot of new empty instances instead of one instance with a lot of empty tabs).
Confirmed also with 17.08.3 on Gentoo.
*** Bug 372979 has been marked as a duplicate of this bug. ***
Git commit 0a73e00e6dd78e0ad00c79e7e0a3caf71bf4f549 by Алексей Шилин.
Committed on 02/04/2018 at 16:10.
Pushed by aleksejshilin into branch 'Applications/18.04'.
Don't restart the blocking process on session restore
All blocking Kate processes were restarted on session restore which
led to launching (possibly) multiple redundant instances.
This change asks the session manager to not restart such processes.
Note: QObject::connect() is used here because the session manager
can't be accessed directly according to the documentation :
In Qt, session management requests for action are handled by
the two signals QGuiApplication::commitDataRequest() and
QGuiApplication::saveStateRequest(). Both provide a reference
to a QSessionManager object as argument. The session manager
can only be accessed in slots invoked by these signals.
0. Make sure that Plasma is configured to restore previous session
1. Open Dolphin and create 'test1' and 'test2' text files.
2. Open 'test1' in Kate from Dolphin.
3. Open 'test2' in the already running Kate instance from Dolphin.
4. Log out and back in. Check that there are no redundant Kate
Reviewers: #kate, dhaumann
Reviewed By: #kate, dhaumann
Subscribers: ngraham, dhaumann
Differential Revision: https://phabricator.kde.org/D11818
M +12 -0 kate/main.cpp