From 127ac19145207e292e179056ab9a5956f00fac32 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 20 Feb 2016 21:43:25 +0700 Subject: Added support for "Delete session" in Kate session panel. Signed-off-by: Michele Calgaro --- kate/app/kateapp.cpp | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'kate/app/kateapp.cpp') diff --git a/kate/app/kateapp.cpp b/kate/app/kateapp.cpp index 8793569fa..167062245 100644 --- a/kate/app/kateapp.cpp +++ b/kate/app/kateapp.cpp @@ -162,7 +162,8 @@ bool KateApp::startupKate() { if (m_args->isSet("start")) { - // the user has specified the session to open + // the user has specified the session to open. If the session does not exist, + // a new session with the specified name will be created TQCString sessName = m_args->getOption("start"); int sessId = sessionManager()->getSessionIdFromName(sessName); if (sessId != KateSessionManager::INVALID_SESSION) @@ -171,19 +172,7 @@ bool KateApp::startupKate() } else { - int msgres = KMessageBox::warningYesNo(0, i18n("

The session '%1' could not be found." - "

Do you want to start a new session?").arg(sessName), - i18n("Session not found!")); - if (msgres == KMessageBox::Yes) - { - sessionManager()->newSession(TQString::null, true); - } - else - { - // Kate will exit now and notify it is done - TDEStartupInfo::appStarted(startupId()); - return false; - } + sessionManager()->newSession(sessName, true); } } else @@ -203,7 +192,7 @@ bool KateApp::startupKate() } else if (startupOption == "new") { - sessionManager()->newSession(TQString::null, true); + sessionManager()->newSession(); } else // startupOption == "manual" { @@ -212,14 +201,14 @@ bool KateApp::startupKate() switch (result) { case KateSessionChooser::RESULT_OPEN_NEW: - sessionManager()->newSession(TQString::null, true); + sessionManager()->newSession(); break; case KateSessionChooser::RESULT_OPEN_EXISTING: if (!m_sessionManager->activateSession(chooser->getSelectedSessionId())) { // Open a new session in case of error - sessionManager()->newSession(TQString::null, true); + sessionManager()->newSession(); } break; -- cgit v1.2.1