aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/ssh/sshconnection.h
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2017-12-19 12:45:46 +0100
committerhjk <hjk@qt.io>2017-12-19 14:19:31 +0000
commit21c66ce5fdaf9fcf91b4ba72adba691fc64be4a3 (patch)
tree06c49f98300874a2b40bfa7800373679804a217b /src/libs/ssh/sshconnection.h
parentb64c1a96b8b9218a903c7993d58c64f8ca387243 (diff)
Combine some SshConnectionParameter members
Combine host, port, username and password into a 'url' member and add some convenience accessors. Change-Id: Iddc26ff00dad1285c96aa56f196dbc4febe8e974 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/libs/ssh/sshconnection.h')
-rw-r--r--src/libs/ssh/sshconnection.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/libs/ssh/sshconnection.h b/src/libs/ssh/sshconnection.h
index 0e90dce3f8..0fbbbcdf8a 100644
--- a/src/libs/ssh/sshconnection.h
+++ b/src/libs/ssh/sshconnection.h
@@ -36,6 +36,7 @@
#include <QSharedPointer>
#include <QString>
#include <QHostAddress>
+#include <QUrl>
namespace QSsh {
class SftpChannel;
@@ -75,13 +76,19 @@ public:
SshConnectionParameters();
- QString host;
- QString userName;
- QString password;
+ QString host() const { return url.host(); }
+ quint16 port() const { return url.port(); }
+ QString userName() const { return url.userName(); }
+ QString password() const { return url.password(); }
+ void setHost(const QString &host) { url.setHost(host); }
+ void setPort(int port) { url.setPort(port); }
+ void setUserName(const QString &name) { url.setUserName(name); }
+ void setPassword(const QString &password) { url.setPassword(password); }
+
+ QUrl url;
QString privateKeyFile;
int timeout; // In seconds.
AuthenticationType authenticationType;
- quint16 port;
SshConnectionOptions options;
SshHostKeyCheckingMode hostKeyCheckingMode;
SshHostKeyDatabasePtr hostKeyDatabase;