mirror of
https://github.com/KDE/konsole.git
synced 2026-06-11 07:26:10 -04:00
rearrange code placment to keep related items together
This commit is contained in:
@@ -1071,15 +1071,6 @@ QString SSHProcessInfo::format(const QString& input) const
|
||||
{
|
||||
QString output(input);
|
||||
|
||||
// test whether host is an ip address
|
||||
// in which case 'short host' and 'full host'
|
||||
// markers in the input string are replaced with
|
||||
// the full address
|
||||
bool isIpAddress = false;
|
||||
|
||||
struct in_addr address;
|
||||
isIpAddress = inet_aton(_host.toLocal8Bit().constData(), &address) != 0;
|
||||
|
||||
// search for and replace known markers
|
||||
output.replace(QLatin1String("%u"), _user);
|
||||
|
||||
@@ -1093,6 +1084,12 @@ QString SSHProcessInfo::format(const QString& input) const
|
||||
else
|
||||
output.replace(QLatin1String("%U"), _user + '@');
|
||||
|
||||
// test whether host is an ip address
|
||||
// in which case 'short host' and 'full host'
|
||||
// markers in the input string are replaced with
|
||||
// the full address
|
||||
struct in_addr address;
|
||||
const bool isIpAddress = inet_aton(_host.toLocal8Bit().constData(), &address) != 0;
|
||||
if (isIpAddress)
|
||||
output.replace(QLatin1String("%h"), _host);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user