diff options
author | Michele Calgaro <[email protected]> | 2016-02-08 16:39:21 +0700 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2016-02-08 16:39:21 +0700 |
commit | 099c8a8821e896884180f57dda94af5fdbd87aaa (patch) | |
tree | c83cf391dddd78128d29d2a9279d99ff815c73e6 /kate/app/kateapp.cpp | |
parent | de91a161b1555bca58c4c30c6367dcc38750ca17 (diff) | |
download | tdebase-099c8a8821e896884180f57dda94af5fdbd87aaa.tar.gz tdebase-099c8a8821e896884180f57dda94af5fdbd87aaa.zip |
Disabled the old session manager and switched permanently to the new one. Lot of functionality still missing.
It is possible to switch sessions from the session panel (either by the activate pushbutton or by executing a listview item).
Kate's session settings are currently not yet supported (last session is saved and restored by default).
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'kate/app/kateapp.cpp')
-rw-r--r-- | kate/app/kateapp.cpp | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/kate/app/kateapp.cpp b/kate/app/kateapp.cpp index 2ff68ed1a..f6089cb75 100644 --- a/kate/app/kateapp.cpp +++ b/kate/app/kateapp.cpp @@ -75,7 +75,6 @@ KateApp::KateApp (TDECmdLineArgs *args) m_pluginManager = new KatePluginManager (TQT_TQOBJECT(this)); // session manager up - m_oldSessionManager = new OldKateSessionManager (TQT_TQOBJECT(this)); m_sessionManager = KateSessionManager::self(); // application dcop interface @@ -109,7 +108,6 @@ KateApp::~KateApp () delete m_obj; // cu dcop interface delete m_pluginManager; // cu plugin manager delete m_sessionManager; // delete session manager - delete m_oldSessionManager; // delete session manager delete m_docManager; // delete document manager. Do this now, or we crash } @@ -137,24 +135,22 @@ TQString KateApp::kateVersion (bool fullVersion) return fullVersion ? TQString ("2.5.%1").arg(KDE::versionMajor()) : TQString ("%1.%2").arg(2.5); } -void KateApp::restoreKate () +void KateApp::restoreKate() { // restore the nice files ;) we need it - Kate::Document::setOpenErrorDialogsActivated (false); + Kate::Document::setOpenErrorDialogsActivated(false); - // activate again correct session!!! - sessionConfig()->setGroup("General"); - TQString lastSession (sessionConfig()->readEntry ("Last Session", "default.katesession")); - oldSessionManager()->activateSession (new OldKateSession (oldSessionManager(), lastSession, ""), false, false, false); - m_docManager->restoreDocumentList (sessionConfig()); + // restore last session + sessionManager()->restoreLastSession(); + m_docManager->restoreDocumentList(sessionConfig()); - Kate::Document::setOpenErrorDialogsActivated (true); + Kate::Document::setOpenErrorDialogsActivated(true); // restore all windows ;) for (int n=1; TDEMainWindow::canBeRestored(n); n++) newMainWindow(sessionConfig(), TQString ("%1").arg(n)); - // oh, no mainwindow, create one, should not happen, but make sure ;) + // no mainwindow, create one, should not happen, but make sure ;) if (mainWindows() == 0) newMainWindow (); @@ -167,17 +163,24 @@ bool KateApp::startupKate () // user specified session to open if (m_args->isSet ("start")) { - oldSessionManager()->activateSession (oldSessionManager()->giveSession (TQString::fromLocal8Bit(m_args->getOption("start"))), false, false); + // MIKE fixme: need to handle this functionality + sessionManager()->activateSession( + sessionManager()->getSessionIdFromName(TQString::fromLocal8Bit(m_args->getOption("start")))); } else { + // MIKE: for the time being just open last session. + // FIXME: need to add support for startup session options + sessionManager()->restoreLastSession(); + + // MIKE fixme: need to handle this functionality // let the user choose session if possible - if (!oldSessionManager()->chooseSession ()) + /*if (!oldSessionManager()->chooseSession ()) { // we will exit kate now, notify the rest of the world we are done TDEStartupInfo::appStarted (startupId()); return false; - } + }*/ } // oh, no mainwindow, create one, should not happen, but make sure ;) @@ -264,12 +267,13 @@ bool KateApp::startupKate () return true; } -void KateApp::shutdownKate (KateMainWindow *win) +void KateApp::shutdownKate(KateMainWindow *win) { if (!win->queryClose_internal()) return; - oldSessionManager()->saveActiveSession(true, true); + // Save current session here to make sure all GUI elements are saved correctly + sessionManager()->saveActiveSession(); // detach the dcopClient dcopClient()->detach(); @@ -291,11 +295,6 @@ KateDocManager *KateApp::documentManager () return m_docManager; } -OldKateSessionManager *KateApp::oldSessionManager () -{ - return m_oldSessionManager; -} - KateSessionManager* KateApp::sessionManager() { return m_sessionManager; |