Gerrit: Determine server by git remote

Currently SSH only.

Change-Id: Ic29ca20e4c63cb5c692e9dc196ba205f0cbc9c6f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Orgad Shaneh
2017-01-22 00:30:20 +02:00
committed by Orgad Shaneh
parent c317114591
commit 34504ad797
8 changed files with 128 additions and 37 deletions

View File

@@ -108,6 +108,14 @@ QString GerritServer::sshHostArgument() const
return user.isEmpty() ? host : (user + '@' + host);
}
QString GerritServer::url() const
{
QString res = "ssh://" + sshHostArgument();
if (port)
res += ':' + QString::number(port);
return res;
}
bool GerritParameters::equals(const GerritParameters &rhs) const
{
return server == rhs.server && ssh == rhs.ssh && https == rhs.https;