[Konsole-devel] [konsole] [Bug 346768] After login only one tab is present, when several tabs where opened before logout.

Stefan Becker chemobejk at gmail.com
Wed May 6 19:00:38 UTC 2015


https://bugs.kde.org/show_bug.cgi?id=346768

--- Comment #12 from Stefan Becker <chemobejk at gmail.com> ---
Created attachment 92457
  --> https://bugs.kde.org/attachment.cgi?id=92457&action=edit
hacky patch to fix session management handling in KMainWindow

kmxlgui/src/kmainwindow.cpp has:

bool KMWSessionManager::saveState(QSessionManager &)
{
    KConfig *config = KConfigGui::sessionConfig();
    ...
        KMainWindow::memberList().first()->saveGlobalProperties(config);

KConfigGui::sessionConfig() returns the session object of the application, i.e.
the parameter to -session or a new config file name. Once that object is
created it will *never* change.

This is wrong, because ksmserverrc stores the information that is in the
QSessionManager.

The attached patch addresses:

- when KMWSessionManager::saveState() is called, create a new KConfig object
based on the information from QSessionManager. (Hacky, duplicates code from
KConfigGui for the file name)

- ignore the first save event after application has been started & restored
with a valid -session parameter (hacky, we should find out why after
application start a saveState event is generated)

- delete the old session file (MAJOR HACK, IMHO this should be in ksmserver)

With this patch in place:
- konsole saves the session correctly
- ksmserverrc records the correct config file name for konsole
- old session config files are removed

This bug should be moved to "frameworks-kxmlgui" product, but I don't have the
rights for it

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the konsole-devel mailing list