Gerrit: Split GerritServer to its own file

It became much larger than GerritParameters. No reason to keep them
together.

Change-Id: Ib125f124940e95b0e15616d150f6b44fdb428284
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Orgad Shaneh
2017-03-06 23:20:55 +02:00
committed by Orgad Shaneh
parent b7412814ab
commit 69f978efca
9 changed files with 330 additions and 244 deletions

View File

@@ -25,6 +25,8 @@
#pragma once
#include "gerritserver.h"
#include <QStringList>
QT_FORWARD_DECLARE_CLASS(QSettings)
@@ -32,58 +34,6 @@ QT_FORWARD_DECLARE_CLASS(QSettings)
namespace Gerrit {
namespace Internal {
class GerritParameters;
class GerritUser
{
public:
bool isSameAs(const GerritUser &other) const;
QString userName;
QString fullName;
QString email;
};
class GerritServer
{
public:
enum HostType
{
Http,
Https,
Ssh
};
enum UrlType
{
DefaultUrl,
UrlWithHttpUser,
RestUrl
};
GerritServer();
GerritServer(const QString &host, unsigned short port, const QString &userName, HostType type);
bool operator==(const GerritServer &other) const;
QString hostArgument() const;
QString url(UrlType urlType = DefaultUrl) const;
bool fillFromRemote(const QString &remote, const GerritParameters &parameters);
int testConnection();
static QStringList curlArguments();
QString host;
GerritUser user;
QString rootPath; // for http
unsigned short port = 0;
HostType type = Ssh;
bool authenticated = true;
private:
QString curlBinary;
bool setupAuthentication();
bool ascendPath();
bool resolveRoot();
};
class GerritParameters
{
public: