forked from qt-creator/qt-creator
Gerrit: Minor de-noise
Change-Id: I5ed6fcd8f74b982a7b17d924234bffe7c1a8019b Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
70a7f80dba
commit
7a3b216961
@@ -35,6 +35,8 @@
|
|||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
|
||||||
|
using namespace Utils;
|
||||||
|
|
||||||
namespace Gerrit {
|
namespace Gerrit {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -62,8 +64,8 @@ static inline QString detectSsh()
|
|||||||
QString ssh = QStandardPaths::findExecutable(defaultSsh);
|
QString ssh = QStandardPaths::findExecutable(defaultSsh);
|
||||||
if (!ssh.isEmpty())
|
if (!ssh.isEmpty())
|
||||||
return ssh;
|
return ssh;
|
||||||
if (Utils::HostOsInfo::isWindowsHost()) { // Windows: Use ssh.exe from git if it cannot be found.
|
if (HostOsInfo::isWindowsHost()) { // Windows: Use ssh.exe from git if it cannot be found.
|
||||||
Utils::FileName path = GerritPlugin::gitBinDirectory();
|
FileName path = GerritPlugin::gitBinDirectory();
|
||||||
if (!path.isEmpty())
|
if (!path.isEmpty())
|
||||||
ssh = path.appendPath(defaultSsh).toString();
|
ssh = path.appendPath(defaultSsh).toString();
|
||||||
}
|
}
|
||||||
@@ -95,7 +97,7 @@ void GerritParameters::setPortFlagBySshType()
|
|||||||
{
|
{
|
||||||
bool isPlink = false;
|
bool isPlink = false;
|
||||||
if (!ssh.isEmpty()) {
|
if (!ssh.isEmpty()) {
|
||||||
const QString version = Utils::PathChooser::toolVersion(ssh, {"-V"});
|
const QString version = PathChooser::toolVersion(ssh, {"-V"});
|
||||||
isPlink = version.contains("plink", Qt::CaseInsensitive);
|
isPlink = version.contains("plink", Qt::CaseInsensitive);
|
||||||
}
|
}
|
||||||
portFlag = QLatin1String(isPlink ? "-P" : defaultPortFlag);
|
portFlag = QLatin1String(isPlink ? "-P" : defaultPortFlag);
|
||||||
@@ -129,7 +131,7 @@ bool GerritServer::fillFromRemote(const QString &remote, const QString &defaultU
|
|||||||
if (remote.isEmpty() || remote.startsWith('/') || remote.startsWith('.'))
|
if (remote.isEmpty() || remote.startsWith('/') || remote.startsWith('.'))
|
||||||
return false;
|
return false;
|
||||||
// On Windows, local paths typically starts with <drive>:
|
// On Windows, local paths typically starts with <drive>:
|
||||||
if (Utils::HostOsInfo::isWindowsHost() && remote[1] == ':')
|
if (HostOsInfo::isWindowsHost() && remote[1] == ':')
|
||||||
return false;
|
return false;
|
||||||
QRegularExpressionMatch match = remotePattern.match(remote);
|
QRegularExpressionMatch match = remotePattern.match(remote);
|
||||||
if (!match.hasMatch())
|
if (!match.hasMatch())
|
||||||
|
Reference in New Issue
Block a user