Commit 351a0ce3 authored by Laurent Montel's avatar Laurent Montel 😁

Port to QVector<int>

parent c29eb773
......@@ -53,8 +53,8 @@ public:
MailTransport::Socket *normalSocket;
MailTransport::Socket *secureSocket;
QSet< int > connectionResults;
QHash< int, QList<int> > authenticationResults;
QVector< int > connectionResults;
QHash< int, QVector<int> > authenticationResults;
QSet< ServerTest::Capability > capabilityResults;
QHash< int, uint > customPorts;
QTimer *normalSocketTimer;
......@@ -79,7 +79,7 @@ public:
void sendInitialCapabilityQuery(MailTransport::Socket *socket);
bool handlePopConversation(MailTransport::Socket *socket, int type, int stage,
const QString &response, bool *shouldStartTLS);
QList< int > parseAuthenticationList(const QStringList &authentications);
QVector<int> parseAuthenticationList(const QStringList &authentications);
// slots
void slotNormalPossible();
......@@ -121,12 +121,12 @@ void ServerTestPrivate::finalResult()
normalSocketFinished = false;
tlsFinished = false ;
emit q->finished(connectionResults.toList());
emit q->finished(connectionResults);
}
QList< int > ServerTestPrivate::parseAuthenticationList(const QStringList &authentications)
QVector<int> ServerTestPrivate::parseAuthenticationList(const QStringList &authentications)
{
QList< int > result;
QVector<int> result;
for (QStringList::ConstIterator it = authentications.begin();
it != authentications.end(); ++it) {
QString current = (*it).toUpper();
......@@ -594,7 +594,7 @@ QProgressBar *ServerTest::progressBar() const
return d->testProgress;
}
QList< int > ServerTest::normalProtocols() const
QVector<int> ServerTest::normalProtocols() const
{
return d->authenticationResults[TransportBase::EnumEncryption::None];
}
......@@ -604,12 +604,12 @@ bool ServerTest::isNormalPossible() const
return d->normalPossible;
}
QList< int > ServerTest::tlsProtocols() const
QVector<int> ServerTest::tlsProtocols() const
{
return d->authenticationResults[TransportBase::EnumEncryption::TLS];
}
QList< int > ServerTest::secureProtocols() const
QVector<int> ServerTest::secureProtocols() const
{
return d->authenticationResults[Transport::EnumEncryption::SSL];
}
......
......@@ -163,7 +163,7 @@ public:
* after the finished() signals has been sent.
* @return an enum of the type Transport::EnumAuthenticationType
*/
QList<int> normalProtocols() const;
QVector<int> normalProtocols() const;
/**
* tells you if the normal server is available
......@@ -177,14 +177,14 @@ public:
* @return an enum of the type Transport::EnumAuthenticationType
* @since 4.1
*/
QList<int> tlsProtocols() const;
QVector<int> tlsProtocols() const;
/**
* Get the protocols for the SSL connections. Call this only
* after the finished() signals has been sent.
* @return an enum of the type Transport::EnumAuthenticationType
*/
QList<int> secureProtocols() const;
QVector<int> secureProtocols() const;
/**
* tells you if the ssl server is available
......@@ -206,7 +206,7 @@ Q_SIGNALS:
* This will be emitted when the test is done. It will contain
* the values from the enum EnumEncryption which are possible.
*/
void finished(const QList<int> &);
void finished(const QVector<int> &);
private:
Q_DECLARE_PRIVATE(ServerTest)
......
......@@ -36,7 +36,7 @@ int main(int argc, char **argv)
test.setProtocol(app.arguments().at(1));
test.setServer(app.arguments().at(2));
test.start();
QObject::connect(&test, &ServerTest::finished, [](const QList<int> &encs) {
QObject::connect(&test, &ServerTest::finished, [](const QVector<int> &encs) {
qDebug() << encs;
QCoreApplication::quit();
});
......
......@@ -52,7 +52,7 @@ public:
QButtonGroup *encryptionGroup;
// detected authentication capabilities
QList<int> noEncCapa, sslCapa, tlsCapa;
QVector<int> noEncCapa, sslCapa, tlsCapa;
bool serverTestFailed;
......@@ -83,7 +83,7 @@ public:
return;
}
QList<int> capa = noEncCapa;
QVector<int> capa = noEncCapa;
if (ui.encryptionSsl->isChecked()) {
capa = sslCapa;
} else if (ui.encryptionTls->isChecked()) {
......@@ -255,7 +255,7 @@ void SMTPConfigWidget::passwordsLoaded()
}
// TODO rename
void SMTPConfigWidget::slotFinished(const QList<int> &results)
void SMTPConfigWidget::slotFinished(const QVector<int> &results)
{
Q_D(SMTPConfigWidget);
......
......@@ -57,7 +57,7 @@ public Q_SLOTS:
private Q_SLOTS:
void checkSmtpCapabilities();
void passwordsLoaded();
void slotFinished(const QList<int> &results);
void slotFinished(const QVector<int> &results);
void hostNameChanged(const QString &text);
void encryptionChanged(int enc);
void ensureValidAuthSelection();
......
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