Gerrit: Factor out server settings

Preparing for gerrit determination by git remote.

Task-number: QTCREATORBUG-8381
Change-Id: Ic862210f40124cd2fb4bb4aa125c7b8e534cd764
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Orgad Shaneh
2017-01-14 23:30:16 +02:00
committed by Orgad Shaneh
parent 5035807f89
commit 2e2c3c39af
6 changed files with 70 additions and 34 deletions

View File

@@ -32,12 +32,32 @@ QT_FORWARD_DECLARE_CLASS(QSettings)
namespace Gerrit {
namespace Internal {
class GerritServer
{
public:
enum HostType
{
Http,
Https,
Ssh
};
GerritServer();
GerritServer(const QString &host, unsigned short port, const QString &user, HostType type);
bool operator==(const GerritServer &other) const;
QString sshHostArgument() const;
QString host;
QString user;
unsigned short port = 0;
HostType type = Ssh;
};
class GerritParameters
{
public:
GerritParameters();
QString sshHostArgument() const;
bool isValid() const;
bool equals(const GerritParameters &rhs) const;
void toSettings(QSettings *) const;
@@ -45,9 +65,7 @@ public:
void fromSettings(const QSettings *);
void setPortFlagBySshType();
QString host;
unsigned short port;
QString user;
GerritServer server;
QString ssh;
QStringList savedQueries;
bool https;