mirror of
https://github.com/qt/qtmqtt.git
synced 2026-10-25 16:16:26 +00:00
Use QList instead of QVector in qtmqtt
Task-number: QTBUG-84469 Change-Id: Id8d2f39fabaec11babddf22cd7e77fb06048d2db Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
This commit is contained in:
parent
f8661b035e
commit
87fbd09c2b
@ -161,8 +161,8 @@ private:
|
||||
QBasicTimer m_pingTimer;
|
||||
int m_pingTimeout{0};
|
||||
|
||||
QVector<QMqttTopicName> m_receiveAliases;
|
||||
QVector<QMqttTopicName> m_publishAliases;
|
||||
QList<QMqttTopicName> m_receiveAliases;
|
||||
QList<QMqttTopicName> m_publishAliases;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
#include "qmqtttopicfilter.h"
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QVector>
|
||||
#include <QtCore/QList>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -241,8 +241,8 @@ bool QMqttTopicFilter::match(const QMqttTopicName &name, MatchOptions matchOptio
|
||||
}
|
||||
|
||||
if (d->filter.contains(QLatin1Char('+'))) {
|
||||
const QVector<QStringView> filterLevels = QStringView{d->filter}.split(QLatin1Char('/'));
|
||||
const QVector<QStringView> topicLevels = QStringView{topic}.split(QLatin1Char('/'));
|
||||
const auto filterLevels = QStringView{d->filter}.split(QLatin1Char('/'));
|
||||
const auto topicLevels = QStringView{topic}.split(QLatin1Char('/'));
|
||||
if (filterLevels.size() != topicLevels.size())
|
||||
return false;
|
||||
for (int i = 0; i < filterLevels.size(); ++i) {
|
||||
|
||||
@ -33,10 +33,10 @@
|
||||
#include <QtMqtt/qmqttglobal.h>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QPair>
|
||||
#include <QtCore/QSharedDataPointer>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QVector>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -66,7 +66,7 @@ private:
|
||||
Q_MQTT_EXPORT QDebug operator<<(QDebug d, const QMqttStringPair &s);
|
||||
#endif
|
||||
|
||||
class Q_MQTT_EXPORT QMqttUserProperties : public QVector<QMqttStringPair>
|
||||
class Q_MQTT_EXPORT QMqttUserProperties : public QList<QMqttStringPair>
|
||||
{
|
||||
public:
|
||||
};
|
||||
|
||||
@ -28,8 +28,8 @@
|
||||
******************************************************************************/
|
||||
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QVector>
|
||||
#include <QtMqtt/QMqttTopicFilter>
|
||||
#include <QtTest/QtTest>
|
||||
|
||||
@ -41,7 +41,7 @@ private Q_SLOTS:
|
||||
void checkValidity();
|
||||
void matches();
|
||||
|
||||
void usableWithQVector();
|
||||
void usableWithQList();
|
||||
void usableWithQMap();
|
||||
void usableWithQHash();
|
||||
};
|
||||
@ -123,10 +123,10 @@ void Tst_QMqttTopicFilter::matches()
|
||||
QVERIFY(QMqttTopicFilter("$SYS/monitor/+").match(QMqttTopicName("$SYS/monitor/Clients"), QMqttTopicFilter::WildcardsDontMatchDollarTopicMatchOption));
|
||||
}
|
||||
|
||||
void Tst_QMqttTopicFilter::usableWithQVector()
|
||||
void Tst_QMqttTopicFilter::usableWithQList()
|
||||
{
|
||||
const QMqttTopicFilter topic{"a/b"};
|
||||
QVector<QMqttTopicFilter> names;
|
||||
QList<QMqttTopicFilter> names;
|
||||
names.append(topic);
|
||||
QCOMPARE(topic, names.constFirst());
|
||||
}
|
||||
|
||||
@ -28,8 +28,8 @@
|
||||
******************************************************************************/
|
||||
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QMap>
|
||||
#include <QtCore/QVector>
|
||||
#include <QtMqtt/QMqttTopicName>
|
||||
#include <QtTest/QtTest>
|
||||
|
||||
@ -42,7 +42,7 @@ private Q_SLOTS:
|
||||
void checkLevelCount();
|
||||
void checkLevels_data();
|
||||
void checkLevels();
|
||||
void usableWithQVector();
|
||||
void usableWithQList();
|
||||
void usableWithQMap();
|
||||
void usableWithQHash();
|
||||
};
|
||||
@ -92,10 +92,10 @@ void Tst_QMqttTopicName::checkLevels()
|
||||
QCOMPARE(name.levels(), levels);
|
||||
}
|
||||
|
||||
void Tst_QMqttTopicName::usableWithQVector()
|
||||
void Tst_QMqttTopicName::usableWithQList()
|
||||
{
|
||||
const QMqttTopicName topic{"a/b"};
|
||||
QVector<QMqttTopicName> names;
|
||||
QList<QMqttTopicName> names;
|
||||
names.append(topic);
|
||||
QCOMPARE(topic, names.constFirst());
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user