From fcd8d7e57d5c0843471635bb0a5cd920d0bd4d0c Mon Sep 17 00:00:00 2001 From: Jekyll Wu Date: Mon, 6 Feb 2012 22:54:44 +0800 Subject: [PATCH] Use customized tab title only when explicitly requested by users --- src/Application.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Application.cpp b/src/Application.cpp index 1a753ba19..5557270e1 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -260,10 +260,14 @@ void Application::createTabFromArgs(KCmdLineArgs* args, MainWindow* window, // Create the new session Session* session = createSession(newProfile, QString(), window->viewManager()); - session->setTabTitleFormat(Session::LocalTabTitle, title); - session->setTabTitleFormat(Session::RemoteTabTitle, title); - // Ensure that new title is displayed - session->setTitle(Session::DisplayedTitleRole, title); + // customize tab title only when explicitly requested + if (!title.isEmpty()) { + session->setTabTitleFormat(Session::LocalTabTitle, title); + session->setTabTitleFormat(Session::RemoteTabTitle, title); + // Ensure that new title is displayed + session->setTitle(Session::DisplayedTitleRole, title); + } + if (!args->isSet("close")) { session->setAutoClose(false); }