Bug 74564 - Kate cannot restore its session
Summary: Kate cannot restore its session
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: 2.2
Platform: Compiled Sources Linux
: NOR major
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-08 13:56 UTC by Chusslove Illich
Modified: 2004-02-17 20:31 UTC (History)
0 users

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


Attachments
Immediate initialization of session config in kdebase/kate/app/katemain.cpp (282 bytes, patch)
2004-02-09 17:38 UTC, Chusslove Illich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chusslove Illich 2004-02-08 13:56:38 UTC
Version:           2.2 (using KDE KDE 3.2.0)
Installed from:    Compiled From Sources
Compiler:          Gcc 3.2.2 
OS:          Linux

After being left open at logout, in new session Kate starts with all session info (opened files, window layout, etc.) lost. Other apps, most notably Kwrite, restore themselves fine. Also, during same session, Kate restores properly when closed/opened.

I've poked the code a bit, but since I don't now first thing about Qt/KDE programming, I've only managed to trace the problem to this point: it seems that, unlike other apps, Kate misses its saved session config name. Here is the listing of what method KApplication::sessionConfig (in kdelibs/kdecore/kapplication.cpp) gets from KApplication::sessionConfigName:

These are at session exit:

session/kwin_117f000001000107572973500000015610000_1076243221_692464
session/konsole_117f000001000107592262400000015610009_1076243221_695938
session/konqueror_117f000001000107623627800000032900009_1076243221_696472
session/kwrite_117f000001000107623904200000073340011_1076243221_696639
session/kate_117f000001000107624295200000024360011_1076243221_698056 <-----
session/kghostview_117f000001000107624321600000024360014_1076243221_763897
session/kwin_117f000001000107572973500000015610000_1076243221_772065

These are at next session start:

session/kwin_117f000001000107572973500000015610000_1076243221_772065
session/konsole_117f000001000107592262400000015610009_1076243221_695938
session/konqueror_117f000001000107623627800000032900009_1076243221_696472
session/kwrite_117f000001000107623904200000073340011_1076243221_696639
session/kate_117f000001000107624295200000024360011_1076243244_730808 <----- Wrong!
session/kghostview_117f000001000107624321600000024360014_1076243221_763897
Comment 1 Chusslove Illich 2004-02-09 17:38:50 UTC
Created attachment 4597 [details]
Immediate initialization of session config in kdebase/kate/app/katemain.cpp

I've poked some more... In KApplication::sessionConfigName(), function
sessionKey() reports the wrong string. However, KApplication::sessionConfig()
will not initialize session config again once already initialized, and
sessionKey() still reports correct value right after declaration "KateApp app;"
in kdebase/kate/app/katemain.cpp, so the problem is dirty-solved by calling
"app.sessionConfig();" right after declaration. The patch is attached.
Comment 2 Leo Savernik 2004-02-12 14:59:18 UTC
Confirming. This is a really annoying bug, esp. with 20 files open for development.
Comment 3 Christoph Cullmann 2004-02-17 20:31:21 UTC
true ;) perhaps I should have read even the comment from 09.02 ;), would have not wasted my time with figuring that out myself ;) (but in the end, had some good results, have rewritten the rest of session restore, too)
backport is now in KDE_3_2_BRANCH, therefor will be in kde 3.2.1 ;)