summaryrefslogtreecommitdiff
path: root/tests/manual/ssh/errorhandling/main.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@nokia.com>2012-05-29 13:22:33 +0200
committerChristian Kandeler <christian.kandeler@nokia.com>2012-05-29 19:07:08 +0200
commit94ab29519b68e4b98701b50ea29ccea2c0522027 (patch)
tree8b90a7cefc903af38d1dec4d066ff56bff26e9af /tests/manual/ssh/errorhandling/main.cpp
parent6886dcb787aa0cd94dc1057b3e5be678f8516e04 (diff)
downloadqt-creator-94ab29519b68e4b98701b50ea29ccea2c0522027.tar.gz
SSH: Use plain pointers to SshConnection objects.
It used to be shared pointers so that existing connection objects could easily be passed around in order not to open a new connection to the same server. Since the introduction of the SshConnectionManager, this is no longer necessary. Change-Id: I13fd3eceaf35d562e6260e9969abbffb01edd6b5 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Diffstat (limited to 'tests/manual/ssh/errorhandling/main.cpp')
-rw-r--r--tests/manual/ssh/errorhandling/main.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/tests/manual/ssh/errorhandling/main.cpp b/tests/manual/ssh/errorhandling/main.cpp
index 67f0a4faaa..a0196d7e98 100644
--- a/tests/manual/ssh/errorhandling/main.cpp
+++ b/tests/manual/ssh/errorhandling/main.cpp
@@ -48,7 +48,7 @@ public:
Test()
{
m_timeoutTimer.setSingleShot(true);
- m_connection = SshConnection::create(SshConnectionParameters());
+ m_connection = new SshConnection(SshConnectionParameters());
if (m_connection->state() != SshConnection::Unconnected) {
qDebug("Error: Newly created SSH connection has state %d.",
m_connection->state());
@@ -107,7 +107,10 @@ public:
runNextTest();
}
- ~Test();
+ ~Test()
+ {
+ delete m_connection;
+ }
private slots:
void handleConnected()
@@ -164,17 +167,15 @@ private slots:
private:
void runNextTest()
{
- if (m_connection)
- disconnect(m_connection.data(), 0, this, 0);
- m_connection = SshConnection::create(m_testSet.first().params);
- connect(m_connection.data(), SIGNAL(connected()), this,
- SLOT(handleConnected()));
- connect(m_connection.data(), SIGNAL(disconnected()), this,
- SLOT(handleDisconnected()));
- connect(m_connection.data(), SIGNAL(dataAvailable(QString)), this,
- SLOT(handleDataAvailable(QString)));
- connect(m_connection.data(), SIGNAL(error(QSsh::SshError)), this,
- SLOT(handleError(QSsh::SshError)));
+ if (m_connection) {
+ disconnect(m_connection, 0, this, 0);
+ delete m_connection;
+ }
+ m_connection = new SshConnection(m_testSet.first().params);
+ connect(m_connection, SIGNAL(connected()), SLOT(handleConnected()));
+ connect(m_connection, SIGNAL(disconnected()), SLOT(handleDisconnected()));
+ connect(m_connection, SIGNAL(dataAvailable(QString)), SLOT(handleDataAvailable(QString)));
+ connect(m_connection, SIGNAL(error(QSsh::SshError)), SLOT(handleError(QSsh::SshError)));
const TestItem &nextItem = m_testSet.first();
m_timeoutTimer.stop();
m_timeoutTimer.setInterval(qMax(10000, nextItem.params.timeout * 1000));
@@ -182,7 +183,7 @@ private:
m_connection->connectToHost();
}
- SshConnection::Ptr m_connection;
+ SshConnection *m_connection;
typedef QList<SshError> ErrorList;
struct TestItem {
TestItem(const char *d, const SshConnectionParameters &p,
@@ -196,8 +197,6 @@ private:
QTimer m_timeoutTimer;
};
-Test::~Test() {}
-
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);