forked from qt-creator/qt-creator
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:
committed by
Orgad Shaneh
parent
b7412814ab
commit
69f978efca
@@ -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 ¶meters);
|
||||
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:
|
||||
|
||||
Reference in New Issue
Block a user