Commit e0737299 authored by Pino Toscano's avatar Pino Toscano

servertest: avoid duplicates

Commit 351a0ce3, which switched from
QList to QVector, also switched a QSet to QVector: this gives as result
duplicate items for the connection results.

Since having duplicate items does not make sense, then switch the
internal storage back to QSet, manually converting it to the QVector
that is emitted as parameter of the finished signal.
parent 9c7d4917
......@@ -31,6 +31,7 @@
#include <QHostInfo>
#include <QProgressBar>
#include <QTimer>
#include <QSet>
// KDE
#include "mailtransport_debug.h"
......@@ -51,7 +52,7 @@ public:
MailTransport::Socket *normalSocket;
MailTransport::Socket *secureSocket;
QVector< int > connectionResults;
QSet< int > connectionResults;
QHash< int, QVector<int> > authenticationResults;
QSet< ServerTest::Capability > capabilityResults;
QHash< int, uint > customPorts;
......@@ -121,7 +122,13 @@ void ServerTestPrivate::finalResult()
normalSocketFinished = false;
tlsFinished = false;
emit q->finished(connectionResults);
QVector<int> resultsAsVector;
resultsAsVector.reserve(connectionResults.size());
foreach (int res, connectionResults) {
resultsAsVector.append(res);
}
emit q->finished(resultsAsVector);
}
QVector<int> ServerTestPrivate::parseAuthenticationList(const QStringList &authentications)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment