SUMMARY When automatic saving and restoring of unsaved changes is enabled, and there are unsaved changes, Kate quits without asking for confirmation—but it doesn't actually restore changes when it's started again. STEPS TO REPRODUCE 1. If you don't currently have a saved session, create and save one. 2. In Configure/Session, enable Automatically save and restore: Files with unsaved changes. 3. Open a file, and make some changes. 4. Quit Kate. 5. Start Kate again. OBSERVED RESULT The changes are lost. The swap file is deleted when you quit Kate. EXPECTED RESULT The changes are restored. SOFTWARE/OS VERSIONS Operating System: openSUSE Tumbleweed 20220124 KDE Plasma Version: 5.23.5 KDE Frameworks Version: 5.90.0 Qt Version: 5.15.2 Graphics Platform: X11
I reported this 10 months ago in https://invent.kde.org/utilities/kate/-/merge_requests/228#note_198079 and can confirm that the issue is still present.
I can reproduce it if I quit Kate using Quit or Ctrl+Q shortcut but not when using Alt+F4. Am I the only one in this situation ?
(In reply to Méven Car from comment #2) > I can reproduce it if I quit Kate using Quit or Ctrl+Q shortcut but not when > using Alt+F4. > Am I the only one in this situation ? This indeed seems to be the case. If I make some changes, then exit with Alt+F4 (or closing the window with the mouse), then I restart Kate, and quit with Ctrl+Q, then even the changes made before quitting with Alt+F4 are lost.
That probably explains why others weren't able to reproduce it. I always quit apps with Ctrl+Q and never use Alt+F4. Curious that these use different codepaths.
> Curious that these use different codepaths. One is explicitly quitting, the other is closing the window where Qt goes "alrght, all my windows are closed, better quit now". I suppose file_quit action is explicitly wired to save the session and then calls qApp->quit, whereas Qt just calls quits internally, effectively bypassing the save.
(In reply to Kai Uwe Broulik from comment #5) > > Curious that these use different codepaths. > > One is explicitly quitting, the other is closing the window where Qt goes > "alrght, all my windows are closed, better quit now". > > I suppose file_quit action is explicitly wired to save the session and then > calls qApp->quit, whereas Qt just calls quits internally, effectively > bypassing the save. But it's the other way around: unsaved changes are retained when quitting by closing the window (Alt+F4), and doesn't work when quitting with File/Quit (Ctrl+Q).
Git commit 0319a51438be5170f75c99b8ad72de7a1354c585 by Christoph Cullmann, on behalf of Waqar Ahmed. Committed on 08/02/2022 at 16:35. Pushed by cullmann into branch 'master'. Fix stashing not working when Kate is quit using Ctrl+Q M +1 -0 kate/kateapp.cpp https://invent.kde.org/utilities/kate/commit/0319a51438be5170f75c99b8ad72de7a1354c585
Git commit 9f87e0106a912237e586db592f4d6eae396f673d by Christoph Cullmann, on behalf of Waqar Ahmed. Committed on 08/02/2022 at 16:43. Pushed by cullmann into branch 'release/21.12'. Fix stashing not working when Kate is quit using Ctrl+Q (cherry picked from commit 0319a51438be5170f75c99b8ad72de7a1354c585) M +1 -0 kate/kateapp.cpp https://invent.kde.org/utilities/kate/commit/9f87e0106a912237e586db592f4d6eae396f673d