Commit 2b2dbdfd authored by Luis Javier Merino's avatar Luis Javier Merino Committed by Kurt Hindenburg
Browse files

Make %w and %# work for bell notifications

Since commit c3982cfb, bell notifications include the display title, in
addition to the name title, to help identifying which tab the
notification came from.  Unfortunately, %w (which can be quite useful in
identifying tabs) and %# weren't working for this case, neither for the
DBUS query:

qdbus $KONSOLE_DBUS_SERVICE $KONSOLE_DBUS_SESSION org.kde.konsole.Session.title 1

BUG: 435644
parent 7f2e1064
Pipeline #121744 passed with stage
in 1 minute and 56 seconds
......@@ -1104,7 +1104,10 @@ QString Session::getDynamicTitle()
bool ok = false;
if (process->name(&ok) == QLatin1String("ssh") && ok) {
SSHProcessInfo sshInfo(*process);
return sshInfo.format(tabTitleFormat(Session::RemoteTabTitle));
QString title = tabTitleFormat(Session::RemoteTabTitle);
title.replace(QLatin1String("%w"), userTitle());
title.replace(QLatin1String("%#"), QString::number(sessionId()));
return sshInfo.format(title);
......@@ -1124,6 +1127,9 @@ QString Session::getDynamicTitle()
* 'bob' would be returned)
* </li>
* <li> %D - Replaced with the current working directory of the process. </li>
* <li> %h - Replaced with the local host name. <li>
* <li> %w - Replaced with the window title set by the shell. </li>
* <li> %# - Replaced with the number of the session. <li>
* </ul>
QString title = tabTitleFormat(Session::LocalTabTitle);
......@@ -1145,6 +1151,9 @@ QString Session::getDynamicTitle()
title.replace(QLatin1String("%h"), Konsole::ProcessInfo::localHost());
title.replace(QLatin1String("%n"), process->name(&ok));
title.replace(QLatin1String("%w"), userTitle());
title.replace(QLatin1String("%#"), QString::number(sessionId()));
QString dir = _reportedWorkingUrl.toLocalFile();
ok = true;
if (dir.isEmpty()) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment