Show non-default Port in full host name (%H) in tab bar

Makes it easy to spot several connections to the same host
on different ports (e.g. different controllers on the same
embedded device)
This commit is contained in:
Kai Uwe Broulik
2021-11-12 22:34:57 +01:00
committed by Tomaz Canabrava
parent 7ceb93a376
commit e7d93d906f

View File

@@ -189,7 +189,12 @@ QString SSHProcessInfo::format(const QString &input) const
output.replace(QLatin1String("%h"), _host.left(_host.indexOf(QLatin1Char('.'))));
}
output.replace(QLatin1String("%H"), _host);
QString fullHost = _host;
if (!_port.isEmpty() && _port != QLatin1String("22")) {
fullHost.append(QLatin1Char(':'));
fullHost.append(_port);
}
output.replace(QLatin1String("%H"), fullHost);
output.replace(QLatin1String("%c"), _command);
return output;