diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index c4603fe20..4c9812b1b 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -131,6 +131,7 @@ void MainWindow::activeViewChanged(SessionController* controller) void MainWindow::activeViewTitleChanged(ViewProperties* properties) { setPlainCaption(properties->title()); + setWindowIcon(properties->icon()); } IncrementalSearchBar* MainWindow::searchBar() const diff --git a/src/ProcessInfo.cpp b/src/ProcessInfo.cpp index 67384534b..1a5121b44 100644 --- a/src/ProcessInfo.cpp +++ b/src/ProcessInfo.cpp @@ -63,7 +63,7 @@ QString ProcessInfo::format(const QString& input) const output.replace("%d",QFileInfo(currentDir(&ok)).baseName()); // remove any remaining %[LETTER] sequences - output.replace(QRegExp("%\\w"),QString::null); + // output.replace(QRegExp("%\\w"),QString::null); return output; } @@ -476,7 +476,7 @@ QString SSHProcessInfo::format(const QString& input) const output.replace("%c",_command); // remove any remaining %[LETTER] character sequences - output.replace(QRegExp("%\\w"),QString::null); + // output.replace(QRegExp("%\\w"),QString::null); return output; } diff --git a/src/SessionController.cpp b/src/SessionController.cpp index 7043e4da1..24c23bc4d 100644 --- a/src/SessionController.cpp +++ b/src/SessionController.cpp @@ -138,6 +138,8 @@ void SessionController::snapshot() process = snapshot; bool ok = false; + + // format tab titles using process info QString title; if ( process->name(&ok) == "ssh" && ok ) { @@ -147,11 +149,7 @@ void SessionController::snapshot() else title = process->format(_session->tabTitleFormat(Session::LocalTabTitle) ) ; - if ( !title.simplified().isEmpty() ) - setTitle(title); - else - setTitle(_session->title()); - + if ( snapshot != process ) { delete snapshot; @@ -159,6 +157,15 @@ void SessionController::snapshot() } else delete snapshot; + + // format tab titles using session title + title.replace("%w",_session->userTitle()); + + // apply new title + if ( !title.simplified().isEmpty() ) + setTitle(title); + else + setTitle(_session->title()); } KUrl SessionController::url() const diff --git a/src/TabTitleFormatAction.cpp b/src/TabTitleFormatAction.cpp index 8f5642451..7893aea3e 100644 --- a/src/TabTitleFormatAction.cpp +++ b/src/TabTitleFormatAction.cpp @@ -31,18 +31,18 @@ using namespace Konsole; const TabTitleFormatAction::Element TabTitleFormatAction::_localElements[] = { - { "%n" , i18n("Program Name") }, - { "%p" , i18n("Profile Name") }, - { "%d" , i18n("Current Directory (Short)") }, - { "%D" , i18n("Current Directory (Long)") } + { "%n" , i18n("Program name") }, + { "%d" , i18n("Current directory (Short)") }, + { "%D" , i18n("Current directory (Long)") }, + { "%w" , i18n("Window title set by shell") } }; const int TabTitleFormatAction::_localElementCount = 4; const TabTitleFormatAction::Element TabTitleFormatAction::_remoteElements[] = { - { "%p" , i18n("Profile Name") }, - { "%u" , i18n("User Name") }, - { "%h" , i18n("Remote Host (Short)") }, - { "%H" , i18n("Remote Host (Long)") } + { "%u" , i18n("User name") }, + { "%h" , i18n("Remote host (Short)") }, + { "%H" , i18n("Remote host (Long)") }, + { "%w" , i18n("Window title set by shell") } }; const int TabTitleFormatAction::_remoteElementCount = 4; diff --git a/src/ViewSplitter.cpp b/src/ViewSplitter.cpp index a2ed705a3..c8a69b688 100644 --- a/src/ViewSplitter.cpp +++ b/src/ViewSplitter.cpp @@ -62,7 +62,7 @@ void ViewSplitter::adjustContainerSize(ViewContainer* container , int percentage // qDebug() << "Old container size:" << oldSize << ", new size:" << newSize; - int perContainerDelta = ( (newSize-oldSize) / (count()-1) ) * (-1); + int perContainerDelta = (count() == 1 ) ? 0 : ( (newSize-oldSize) / (count()-1) ) * (-1); // qDebug() << "Changing sizes of other containers by " << perContainerDelta << "pixels.";