From cf06fa08b38f61ca07d9ee9c3f0be06c93168183 Mon Sep 17 00:00:00 2001 From: Kurt Hindenburg Date: Fri, 31 Mar 2017 08:58:19 -0400 Subject: [PATCH] rearrange code placment to keep related items together --- src/ProcessInfo.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/ProcessInfo.cpp b/src/ProcessInfo.cpp index a3276f40a..d716248c0 100644 --- a/src/ProcessInfo.cpp +++ b/src/ProcessInfo.cpp @@ -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