From 0f9cdfe2dbfabaf495790c07d1dec756550bfe30 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Sun, 6 May 2007 00:58:27 +0000 Subject: [PATCH] Set session title to profile name when created. Rename tab dialog changes the tab title format rather than the session's title itself. svn path=/branches/work/konsole-split-view/; revision=661587 --- src/SessionController.cpp | 10 ++++++---- src/SessionManager.cpp | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/SessionController.cpp b/src/SessionController.cpp index e271c2b61..424fdc371 100644 --- a/src/SessionController.cpp +++ b/src/SessionController.cpp @@ -127,8 +127,10 @@ void SessionController::snapshot() else title = process->format(_session->tabTitleFormat(Session::LocalTabTitle) ) ; - if ( !title.isEmpty() ) - _session->setTitle(title); + if ( !title.simplified().isEmpty() ) + setTitle(title); + else + setTitle(_session->title()); if ( snapshot != process ) { @@ -493,10 +495,10 @@ void SessionController::renameSession() bool ok = false; const QString& text = KInputDialog::getText( i18n("Rename Tab") , i18n("Enter new tab text:") , - _session->title() , + _session->tabTitleFormat(Session::LocalTabTitle) , &ok ); if ( ok ) - _session->setTitle(text); + _session->setTabTitleFormat(Session::LocalTabTitle,text); } void SessionController::saveSession() { diff --git a/src/SessionManager.cpp b/src/SessionManager.cpp index ca3231cf0..d3084d680 100644 --- a/src/SessionManager.cpp +++ b/src/SessionManager.cpp @@ -623,6 +623,9 @@ void SessionManager::applyProfile(Session* session, const Profile* info , bool m session->setType( _types.key((Profile*)info) ); // Basic session settings + if ( !modifiedPropertiesOnly || info->isPropertySet(Profile::Name) ) + session->setTitle(info->name()); + if ( !modifiedPropertiesOnly || info->isPropertySet(Profile::Command) ) session->setProgram(info->command());