rearrange code placment to keep related items together

This commit is contained in:
Kurt Hindenburg
2017-03-31 08:58:19 -04:00
parent a8c3dd0aa5
commit cf06fa08b3

View File

@@ -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