OSDN Git Service

SSH: Allow querying of IP protocol version.
authorChristian Kandeler <christian.kandeler@nokia.com>
Tue, 4 Oct 2011 12:21:37 +0000 (14:21 +0200)
committerChristian Kandeler <christian.kandeler@nokia.com>
Tue, 4 Oct 2011 12:34:29 +0000 (14:34 +0200)
Change-Id: I97c8b89da8c8d46afb0bdc840627e142567d5d98
Reviewed-on: http://codereview.qt-project.org/5981
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
src/libs/utils/ssh/sshconnection.cpp
src/libs/utils/ssh/sshconnection.h

index 7e458e2..dc3ab4f 100644 (file)
@@ -165,6 +165,11 @@ SshConnectionParameters SshConnection::connectionParameters() const
     return d->m_connParams;
 }
 
+QAbstractSocket::NetworkLayerProtocol SshConnection::ipProtocolVersion() const
+{
+    return d->m_socket->localAddress().protocol();
+}
+
 SshConnection::~SshConnection()
 {
     disconnect();
index 83493db..eed00cc 100644 (file)
@@ -41,6 +41,7 @@
 #include <QtCore/QObject>
 #include <QtCore/QSharedPointer>
 #include <QtCore/QString>
+#include <QtNetwork/QAbstractSocket>
 
 namespace Utils {
 class SftpChannel;
@@ -86,6 +87,7 @@ public:
     SshError errorState() const;
     QString errorString() const;
     SshConnectionParameters connectionParameters() const;
+    QAbstractSocket::NetworkLayerProtocol ipProtocolVersion() const;
     ~SshConnection();
 
     QSharedPointer<SshRemoteProcess> createRemoteProcess(const QByteArray &command);