Commit cf06fa08 authored by Kurt Hindenburg's avatar Kurt Hindenburg

rearrange code placment to keep related items together

parent a8c3dd0a
......@@ -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
......
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