From c7614caf4188b6a4d5e80d62943fca147f60a3e0 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Thu, 19 Oct 2023 13:41:46 +0200 Subject: [PATCH] There's no QVector anymore, QList is the QVector in Qt6 --- src/actionshandler.cpp | 2 +- src/actionshandler.h | 2 +- src/chatbarcache.cpp | 2 +- src/chatbarcache.h | 4 ++-- src/events/imagepackevent.h | 4 ++-- src/models/accountemoticonmodel.h | 2 +- src/models/actionsmodel.cpp | 4 ++-- src/models/actionsmodel.h | 2 +- src/models/devicesmodel.h | 2 +- src/models/imagepacksmodel.cpp | 2 +- src/models/imagepacksmodel.h | 6 +++--- src/models/keywordnotificationrulemodel.cpp | 6 +++--- src/models/messageeventmodel.cpp | 4 ++-- src/models/messageeventmodel.h | 4 ++-- src/models/publicroomlistmodel.h | 2 +- src/models/pushrulemodel.cpp | 16 ++++++++-------- src/models/pushrulemodel.h | 6 +++--- src/models/roomlistmodel.cpp | 2 +- src/models/roomlistmodel.h | 2 +- src/models/sortfilterspacelistmodel.cpp | 2 +- src/models/stickermodel.h | 4 ++-- src/models/userdirectorylistmodel.h | 2 +- src/models/userlistmodel.cpp | 2 +- src/models/userlistmodel.h | 2 +- src/neochatconnection.cpp | 4 ++-- src/neochatroom.cpp | 16 ++++++++-------- src/neochatroom.h | 4 ++-- src/registration.cpp | 2 +- src/registration.h | 10 +++++----- src/spacehierarchycache.cpp | 4 ++-- src/spacehierarchycache.h | 8 ++++---- 31 files changed, 67 insertions(+), 67 deletions(-) diff --git a/src/actionshandler.cpp b/src/actionshandler.cpp index 68cf613f1..42dd75385 100644 --- a/src/actionshandler.cpp +++ b/src/actionshandler.cpp @@ -59,7 +59,7 @@ void ActionsHandler::handleMessageEvent(ChatBarCache *chatBarCache) handleMessage(m_room->mainCache()->text(), handledText, chatBarCache); } -QString ActionsHandler::handleMentions(QString handledText, QVector *mentions) +QString ActionsHandler::handleMentions(QString handledText, QList *mentions) { if (!m_room) { return QString(); diff --git a/src/actionshandler.h b/src/actionshandler.h index f6c7cff43..f3a6786bc 100644 --- a/src/actionshandler.h +++ b/src/actionshandler.h @@ -61,6 +61,6 @@ private: NeoChatRoom *m_room = nullptr; void checkEffects(const QString &text); - QString handleMentions(QString handledText, QVector *mentions); + QString handleMentions(QString handledText, QList *mentions); void handleMessage(const QString &text, QString handledText, ChatBarCache *chatBarCache); }; diff --git a/src/chatbarcache.cpp b/src/chatbarcache.cpp index 34d766dc8..54508ff2d 100644 --- a/src/chatbarcache.cpp +++ b/src/chatbarcache.cpp @@ -137,7 +137,7 @@ void ChatBarCache::setAttachmentPath(const QString &attachmentPath) Q_EMIT attachmentPathChanged(); } -QVector *ChatBarCache::mentions() +QList *ChatBarCache::mentions() { return &m_mentions; } diff --git a/src/chatbarcache.h b/src/chatbarcache.h index 988ce38d6..358c059a6 100644 --- a/src/chatbarcache.h +++ b/src/chatbarcache.h @@ -158,7 +158,7 @@ public: /** * @brief Retrieve the mentions for the current chat bar text. */ - QVector *mentions(); + QList *mentions(); /** * @brief Get the saved chat bar text. @@ -180,6 +180,6 @@ private: QString m_relationId = QString(); RelationType m_relationType = RelationType::None; QString m_attachmentPath = QString(); - QVector m_mentions; + QList m_mentions; QString m_savedText; }; diff --git a/src/events/imagepackevent.h b/src/events/imagepackevent.h index 9cf458a44..7c080c037 100644 --- a/src/events/imagepackevent.h +++ b/src/events/imagepackevent.h @@ -3,7 +3,7 @@ #pragma once -#include +#include #include #include @@ -60,7 +60,7 @@ public: * * @sa ImagePackImage */ - QVector images; + QList images; explicit ImagePackEventContent(const QJsonObject &o); diff --git a/src/models/accountemoticonmodel.h b/src/models/accountemoticonmodel.h index 0481ff147..f0cf7c7fb 100644 --- a/src/models/accountemoticonmodel.h +++ b/src/models/accountemoticonmodel.h @@ -7,10 +7,10 @@ #include #include +#include #include #include #include -#include #include diff --git a/src/models/actionsmodel.cpp b/src/models/actionsmodel.cpp index 5ac9a74d7..48ff7f88d 100644 --- a/src/models/actionsmodel.cpp +++ b/src/models/actionsmodel.cpp @@ -55,7 +55,7 @@ auto roomNickLambda = [](const QString &text, NeoChatRoom *room, ChatBarCache *) return QString(); }; -QVector actions{ +QList actions{ Action{ QStringLiteral("shrug"), [](const QString &message, NeoChatRoom *, ChatBarCache *) { @@ -574,7 +574,7 @@ QHash ActionsModel::roleNames() const }; } -QVector &ActionsModel::allActions() const +QList &ActionsModel::allActions() const { return actions; } diff --git a/src/models/actionsmodel.h b/src/models/actionsmodel.h index ab7c23fce..49830aad5 100644 --- a/src/models/actionsmodel.h +++ b/src/models/actionsmodel.h @@ -88,7 +88,7 @@ public: /** * @brief Return a vector with all supported actions. */ - QVector &allActions() const; + QList &allActions() const; private: ActionsModel() = default; diff --git a/src/models/devicesmodel.h b/src/models/devicesmodel.h index 45ba6b25d..a405ec6a3 100644 --- a/src/models/devicesmodel.h +++ b/src/models/devicesmodel.h @@ -98,6 +98,6 @@ Q_SIGNALS: private: void fetchDevices(); - QVector m_devices; + QList m_devices; QPointer m_connection; }; diff --git a/src/models/imagepacksmodel.cpp b/src/models/imagepacksmodel.cpp index a1d352c8f..5cd664153 100644 --- a/src/models/imagepacksmodel.cpp +++ b/src/models/imagepacksmodel.cpp @@ -151,7 +151,7 @@ void ImagePacksModel::setShowEmoticons(bool showEmoticons) m_showEmoticons = showEmoticons; Q_EMIT showEmoticonsChanged(); } -QVector ImagePacksModel::images(int index) +QList ImagePacksModel::images(int index) { if (index < 0 || index >= m_events.size()) { return {}; diff --git a/src/models/imagepacksmodel.h b/src/models/imagepacksmodel.h index 940ac3739..b11659be6 100644 --- a/src/models/imagepacksmodel.h +++ b/src/models/imagepacksmodel.h @@ -5,9 +5,9 @@ #include "events/imagepackevent.h" #include +#include #include #include -#include class NeoChatRoom; @@ -86,7 +86,7 @@ public: /** * @brief Return a vector of the images in the pack at the given index. */ - [[nodiscard]] QVector images(int index); + [[nodiscard]] QList images(int index); Q_SIGNALS: void roomChanged(); @@ -96,7 +96,7 @@ Q_SIGNALS: private: QPointer m_room; - QVector m_events; + QList m_events; bool m_showStickers = true; bool m_showEmoticons = true; void reloadImages(); diff --git a/src/models/keywordnotificationrulemodel.cpp b/src/models/keywordnotificationrulemodel.cpp index fb169d52a..e8d9d6d67 100644 --- a/src/models/keywordnotificationrulemodel.cpp +++ b/src/models/keywordnotificationrulemodel.cpp @@ -35,7 +35,7 @@ void KeywordNotificationRuleModel::updateNotificationRules(const QString &type) const QJsonObject ruleDataJson = Controller::instance().activeConnection()->accountDataJson("m.push_rules"); const Quotient::PushRuleset ruleData = Quotient::fromJson(ruleDataJson["global"].toObject()); - const QVector contentRules = ruleData.content; + const QList contentRules = ruleData.content; beginResetModel(); m_notificationRules.clear(); @@ -78,11 +78,11 @@ void KeywordNotificationRuleModel::addKeyword(const QString &keyword) NotificationsManager::instance().initializeKeywordNotificationAction(); } - const QVector actions = NotificationsManager::instance().getKeywordNotificationActions(); + const QList actions = NotificationsManager::instance().getKeywordNotificationActions(); auto job = Controller::instance() .activeConnection() - ->callApi("global", "content", keyword, actions, "", "", QVector(), keyword); + ->callApi("global", "content", keyword, actions, "", "", QList(), keyword); connect(job, &Quotient::BaseJob::success, this, [this, keyword]() { beginInsertRows(QModelIndex(), m_notificationRules.count(), m_notificationRules.count()); m_notificationRules.append(keyword); diff --git a/src/models/messageeventmodel.cpp b/src/models/messageeventmodel.cpp index 49d546cf2..c53f298dc 100644 --- a/src/models/messageeventmodel.cpp +++ b/src/models/messageeventmodel.cpp @@ -266,7 +266,7 @@ int MessageEventModel::timelineBaseIndex() const return m_currentRoom ? int(m_currentRoom->pendingEvents().size()) : 0; } -void MessageEventModel::refreshEventRoles(int row, const QVector &roles) +void MessageEventModel::refreshEventRoles(int row, const QList &roles) { const auto idx = index(row); Q_EMIT dataChanged(idx, idx, roles); @@ -310,7 +310,7 @@ void MessageEventModel::moveReadMarker(const QString &toEventId) endMoveRows(); } -int MessageEventModel::refreshEventRoles(const QString &id, const QVector &roles) +int MessageEventModel::refreshEventRoles(const QString &id, const QList &roles) { // On 64-bit platforms, difference_type for std containers is long long // but Qt uses int throughout its interfaces; hence casting to int below. diff --git a/src/models/messageeventmodel.h b/src/models/messageeventmodel.h index 15df90d0b..d1d328a4c 100644 --- a/src/models/messageeventmodel.h +++ b/src/models/messageeventmodel.h @@ -137,8 +137,8 @@ private: void fetchMore(const QModelIndex &parent) override; void refreshLastUserEvents(int baseTimelineRow); - void refreshEventRoles(int row, const QVector &roles = {}); - int refreshEventRoles(const QString &eventId, const QVector &roles = {}); + void refreshEventRoles(int row, const QList &roles = {}); + int refreshEventRoles(const QString &eventId, const QList &roles = {}); void moveReadMarker(const QString &toEventId); void createEventObjects(const Quotient::RoomMessageEvent *event); diff --git a/src/models/publicroomlistmodel.h b/src/models/publicroomlistmodel.h index 06bb5d197..73a1d0626 100644 --- a/src/models/publicroomlistmodel.h +++ b/src/models/publicroomlistmodel.h @@ -132,7 +132,7 @@ private: bool m_loading = false; QString nextBatch; - QVector rooms; + QList rooms; Quotient::QueryPublicRoomsJob *job = nullptr; diff --git a/src/models/pushrulemodel.cpp b/src/models/pushrulemodel.cpp index 25dbf1e99..bf1e0e643 100644 --- a/src/models/pushrulemodel.cpp +++ b/src/models/pushrulemodel.cpp @@ -106,7 +106,7 @@ void PushRuleModel::updateNotificationRules(const QString &type) endResetModel(); } -void PushRuleModel::setRules(QVector rules, PushNotificationKind::Kind kind) +void PushRuleModel::setRules(QList rules, PushNotificationKind::Kind kind) { for (const auto &rule : rules) { QString roomId; @@ -307,8 +307,8 @@ void PushRuleModel::setPushRuleAction(const QString &id, PushNotificationAction: void PushRuleModel::addKeyword(const QString &keyword, const QString &roomId) { PushNotificationKind::Kind kind = PushNotificationKind::Content; - const QVector actions = actionToVariant(m_defaultKeywordAction); - QVector pushConditions; + const QList actions = actionToVariant(m_defaultKeywordAction); + QList pushConditions; if (!roomId.isEmpty()) { kind = PushNotificationKind::Override; @@ -369,7 +369,7 @@ void PushRuleModel::setNotificationRuleEnabled(const QString &kind, const QStrin void PushRuleModel::setNotificationRuleActions(const QString &kind, const QString &ruleId, PushNotificationAction::Action action) { - QVector actions; + QList actions; if (ruleId == QStringLiteral(".m.rule.call")) { actions = actionToVariant(action, QStringLiteral("ring")); } else { @@ -379,7 +379,7 @@ void PushRuleModel::setNotificationRuleActions(const QString &kind, const QStrin Controller::instance().activeConnection()->callApi(QStringLiteral("global"), kind, ruleId, actions); } -PushNotificationAction::Action PushRuleModel::variantToAction(const QVector &actions, bool enabled) +PushNotificationAction::Action PushRuleModel::variantToAction(const QList &actions, bool enabled) { bool notify = false; bool isNoisy = false; @@ -422,16 +422,16 @@ PushNotificationAction::Action PushRuleModel::variantToAction(const QVector PushRuleModel::actionToVariant(PushNotificationAction::Action action, const QString &sound) +QList PushRuleModel::actionToVariant(PushNotificationAction::Action action, const QString &sound) { // The caller should never try to set the state to unknown. // It exists only as a default state to diable the settings options until the actual state is retrieved from the server. if (action == PushNotificationAction::Unknown) { Q_ASSERT(false); - return QVector(); + return QList(); } - QVector actions; + QList actions; if (action != PushNotificationAction::Off) { actions.append(QStringLiteral("notify")); diff --git a/src/models/pushrulemodel.h b/src/models/pushrulemodel.h index 0e4ed0e09..d0f5163b5 100644 --- a/src/models/pushrulemodel.h +++ b/src/models/pushrulemodel.h @@ -238,14 +238,14 @@ private: PushNotificationAction::Action m_defaultKeywordAction; QList m_rules; - void setRules(QVector rules, PushNotificationKind::Kind kind); + void setRules(QList rules, PushNotificationKind::Kind kind); int getRuleIndex(const QString &ruleId) const; PushNotificationSection::Section getSection(Quotient::PushRule rule); void setNotificationRuleEnabled(const QString &kind, const QString &ruleId, bool enabled); void setNotificationRuleActions(const QString &kind, const QString &ruleId, PushNotificationAction::Action action); - PushNotificationAction::Action variantToAction(const QVector &actions, bool enabled); - QVector actionToVariant(PushNotificationAction::Action action, const QString &sound = QStringLiteral("default")); + PushNotificationAction::Action variantToAction(const QList &actions, bool enabled); + QList actionToVariant(PushNotificationAction::Action action, const QString &sound = QStringLiteral("default")); }; Q_DECLARE_METATYPE(PushRuleModel *) diff --git a/src/models/roomlistmodel.cpp b/src/models/roomlistmodel.cpp index 0dc1a656d..df0afc3fc 100644 --- a/src/models/roomlistmodel.cpp +++ b/src/models/roomlistmodel.cpp @@ -372,7 +372,7 @@ QVariant RoomListModel::data(const QModelIndex &index, int role) const return QVariant(); } -void RoomListModel::refresh(NeoChatRoom *room, const QVector &roles) +void RoomListModel::refresh(NeoChatRoom *room, const QList &roles) { const auto it = std::find(m_rooms.begin(), m_rooms.end(), room); if (it == m_rooms.end()) { diff --git a/src/models/roomlistmodel.h b/src/models/roomlistmodel.h index 3f56eb534..141cc1fc6 100644 --- a/src/models/roomlistmodel.h +++ b/src/models/roomlistmodel.h @@ -158,7 +158,7 @@ private Q_SLOTS: void doAddRoom(Quotient::Room *room); void updateRoom(Quotient::Room *room, Quotient::Room *prev); void deleteRoom(Quotient::Room *room); - void refresh(NeoChatRoom *room, const QVector &roles = {}); + void refresh(NeoChatRoom *room, const QList &roles = {}); void refreshNotificationCount(); void refreshHighlightCount(); diff --git a/src/models/sortfilterspacelistmodel.cpp b/src/models/sortfilterspacelistmodel.cpp index ec8f5cad6..d0263fded 100644 --- a/src/models/sortfilterspacelistmodel.cpp +++ b/src/models/sortfilterspacelistmodel.cpp @@ -12,7 +12,7 @@ SortFilterSpaceListModel::SortFilterSpaceListModel(QObject *parent) sort(0); invalidateFilter(); connect(this, &QAbstractProxyModel::sourceModelChanged, this, [this]() { - connect(sourceModel(), &QAbstractListModel::dataChanged, this, [this](const QModelIndex &, const QModelIndex &, QVector roles) { + connect(sourceModel(), &QAbstractListModel::dataChanged, this, [this](const QModelIndex &, const QModelIndex &, QList roles) { if (roles.contains(RoomListModel::IsChildSpaceRole)) { invalidate(); } diff --git a/src/models/stickermodel.h b/src/models/stickermodel.h index 4c25a3fe8..8cc85c7b6 100644 --- a/src/models/stickermodel.h +++ b/src/models/stickermodel.h @@ -6,9 +6,9 @@ #include "events/imagepackevent.h" #include "neochatroom.h" #include +#include #include #include -#include class ImagePacksModel; @@ -100,7 +100,7 @@ Q_SIGNALS: private: ImagePacksModel *m_model = nullptr; int m_index = 0; - QVector m_images; + QList m_images; NeoChatRoom *m_room; void reloadImages(); }; diff --git a/src/models/userdirectorylistmodel.h b/src/models/userdirectorylistmodel.h index d4bceb00a..2fb88d2c8 100644 --- a/src/models/userdirectorylistmodel.h +++ b/src/models/userdirectorylistmodel.h @@ -103,7 +103,7 @@ private: bool attempted = false; - QVector users; + QList users; Quotient::SearchUserDirectoryJob *job = nullptr; }; diff --git a/src/models/userlistmodel.cpp b/src/models/userlistmodel.cpp index d0d73aeb4..85bc8e497 100644 --- a/src/models/userlistmodel.cpp +++ b/src/models/userlistmodel.cpp @@ -145,7 +145,7 @@ void UserListModel::userRemoved(Quotient::User *user) } } -void UserListModel::refreshUser(Quotient::User *user, const QVector &roles) +void UserListModel::refreshUser(Quotient::User *user, const QList &roles) { auto pos = findUserPos(user); if (pos != m_users.size()) { diff --git a/src/models/userlistmodel.h b/src/models/userlistmodel.h index 4d1e0bd46..99c5b46b4 100644 --- a/src/models/userlistmodel.h +++ b/src/models/userlistmodel.h @@ -89,7 +89,7 @@ Q_SIGNALS: private Q_SLOTS: void userAdded(Quotient::User *user); void userRemoved(Quotient::User *user); - void refreshUser(Quotient::User *user, const QVector &roles = {}); + void refreshUser(Quotient::User *user, const QList &roles = {}); void refreshAllUsers(); private: diff --git a/src/neochatconnection.cpp b/src/neochatconnection.cpp index 0f02a0bb0..9d4f3c0d2 100644 --- a/src/neochatconnection.cpp +++ b/src/neochatconnection.cpp @@ -158,7 +158,7 @@ void NeoChatConnection::deactivateAccount(const QString &password) void NeoChatConnection::createRoom(const QString &name, const QString &topic, const QString &parent, bool setChildParent) { - QVector initialStateEvents; + QList initialStateEvents; if (!parent.isEmpty()) { initialStateEvents.append(CreateRoomJob::StateEvent{ "m.space.parent"_ls, @@ -190,7 +190,7 @@ void NeoChatConnection::createRoom(const QString &name, const QString &topic, co void NeoChatConnection::createSpace(const QString &name, const QString &topic, const QString &parent, bool setChildParent) { - QVector initialStateEvents; + QList initialStateEvents; if (!parent.isEmpty()) { initialStateEvents.append(CreateRoomJob::StateEvent{ "m.space.parent"_ls, diff --git a/src/neochatroom.cpp b/src/neochatroom.cpp index ff7821e29..ce7a161ba 100644 --- a/src/neochatroom.cpp +++ b/src/neochatroom.cpp @@ -1110,10 +1110,10 @@ bool NeoChatRoom::hasParent() const return currentState().eventsOfType("m.space.parent"_ls).size() > 0; } -QVector NeoChatRoom::parentIds() const +QList NeoChatRoom::parentIds() const { auto parentEvents = currentState().eventsOfType("m.space.parent"_ls); - QVector parentIds; + QList parentIds; for (const auto &parentEvent : parentEvents) { if (parentEvent->contentJson().contains("via"_ls) && !parentEvent->contentPart("via"_ls).isEmpty()) { parentIds += parentEvent->stateKey(); @@ -1346,7 +1346,7 @@ void NeoChatRoom::setPushNotificationState(PushNotificationState::State state) * "don't_notify" * ] */ - const QVector actions = {"dont_notify"_ls}; + const QList actions = {"dont_notify"_ls}; /** * Setup the push condition to get all events for the current room * see https://spec.matrix.org/v1.3/client-server-api/#conditions-1 @@ -1363,7 +1363,7 @@ void NeoChatRoom::setPushNotificationState(PushNotificationState::State state) pushCondition.kind = "event_match"_ls; pushCondition.key = "room_id"_ls; pushCondition.pattern = id(); - const QVector conditions = {pushCondition}; + const QList conditions = {pushCondition}; // Add new override rule and make sure it's enabled auto job = Controller::instance() @@ -1390,9 +1390,9 @@ void NeoChatRoom::setPushNotificationState(PushNotificationState::State state) * "don't_notify" * ] */ - const QVector actions = {"dont_notify"_ls}; + const QList actions = {"dont_notify"_ls}; // No conditions for a room rule - const QVector conditions; + const QList conditions; auto setJob = Controller::instance() .activeConnection() @@ -1422,9 +1422,9 @@ void NeoChatRoom::setPushNotificationState(PushNotificationState::State state) QJsonObject tweaks; tweaks.insert("set_tweak"_ls, "sound"_ls); tweaks.insert("value"_ls, "default"_ls); - const QVector actions = {"notify"_ls, tweaks}; + const QList actions = {"notify"_ls, tweaks}; // No conditions for a room rule - const QVector conditions; + const QList conditions; // Add new room rule and make sure enabled auto setJob = Controller::instance() diff --git a/src/neochatroom.h b/src/neochatroom.h index f324e6a32..895b91cc2 100644 --- a/src/neochatroom.h +++ b/src/neochatroom.h @@ -122,7 +122,7 @@ class NeoChatRoom : public Quotient::Room * * Empty if no parent space is set. */ - Q_PROPERTY(QVector parentIds READ parentIds NOTIFY parentIdsChanged) + Q_PROPERTY(QList parentIds READ parentIds NOTIFY parentIdsChanged) /** * @brief The current canonical parent for the room. @@ -525,7 +525,7 @@ public: */ Q_INVOKABLE bool hasParent() const; - QVector parentIds() const; + QList parentIds() const; QString canonicalParent() const; void setCanonicalParent(const QString &parentId); diff --git a/src/registration.cpp b/src/registration.cpp index 18be5ff54..5fe7fa50d 100644 --- a/src/registration.cpp +++ b/src/registration.cpp @@ -226,7 +226,7 @@ void Registration::testUsername() }); } -QVector Registration::terms() const +QList Registration::terms() const { return m_terms; } diff --git a/src/registration.h b/src/registration.h index d53fd11a1..fa5e994f8 100644 --- a/src/registration.h +++ b/src/registration.h @@ -4,12 +4,12 @@ #pragma once #include +#include #include #include #include #include #include -#include #include @@ -69,7 +69,7 @@ class Registration : public QObject Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged) Q_PROPERTY(QString email READ email WRITE setEmail NOTIFY emailChanged) Q_PROPERTY(QString nextStep READ nextStep WRITE setNextStep NOTIFY nextStepChanged) - Q_PROPERTY(QVector terms READ terms NOTIFY termsChanged) + Q_PROPERTY(QList terms READ terms NOTIFY termsChanged) Q_PROPERTY(Status status READ status NOTIFY statusChanged) Q_PROPERTY(QString statusString READ statusString NOTIFY statusChanged) @@ -121,7 +121,7 @@ public: QString nextStep() const; void setNextStep(const QString &nextStep); - QVector terms() const; + QList terms() const; Status status() const; QString statusString() const; @@ -148,7 +148,7 @@ private: QString m_homeserver; QString m_username; QString m_password; - QVector m_terms; + QList m_terms; QString m_email; Status m_status = NoServer; QString m_nextStep; @@ -158,7 +158,7 @@ private: QPointer m_usernameJob; QPointer m_testServerJob; - QVector> m_flows; + QList> m_flows; QPointer m_connection; void testHomeserver(); diff --git a/src/spacehierarchycache.cpp b/src/spacehierarchycache.cpp index aac45b127..515f733f9 100644 --- a/src/spacehierarchycache.cpp +++ b/src/spacehierarchycache.cpp @@ -54,7 +54,7 @@ void SpaceHierarchyCache::populateSpaceHierarchy(const QString &spaceId) connect(job, &BaseJob::success, this, [this, job, spaceId]() { const auto rooms = job->rooms(); - QVector roomList; + QList roomList; for (unsigned long i = 0; i < rooms.size(); ++i) { for (const auto &state : rooms[i].childrenState) { roomList.push_back(state->stateKey()); @@ -83,7 +83,7 @@ void SpaceHierarchyCache::removeSpaceFromHierarchy(Quotient::Room *room) } } -QVector &SpaceHierarchyCache::getRoomListForSpace(const QString &spaceId, bool updateCache) +QList &SpaceHierarchyCache::getRoomListForSpace(const QString &spaceId, bool updateCache) { if (updateCache) { populateSpaceHierarchy(spaceId); diff --git a/src/spacehierarchycache.h b/src/spacehierarchycache.h index ed4147a5a..15aee8ee7 100644 --- a/src/spacehierarchycache.h +++ b/src/spacehierarchycache.h @@ -5,10 +5,10 @@ #pragma once #include +#include #include #include #include -#include namespace Quotient { @@ -43,7 +43,7 @@ public: /** * @brief Return the list of child rooms for the given space ID. */ - [[nodiscard]] QVector &getRoomListForSpace(const QString &spaceId, bool updateCache); + [[nodiscard]] QList &getRoomListForSpace(const QString &spaceId, bool updateCache); /** * @brief Returns whether the space is a child space of any other space. @@ -60,8 +60,8 @@ private Q_SLOTS: private: explicit SpaceHierarchyCache(QObject *parent = nullptr); - QVector m_activeSpaceRooms; - QHash> m_spaceHierarchy; + QList m_activeSpaceRooms; + QHash> m_spaceHierarchy; void cacheSpaceHierarchy(); void populateSpaceHierarchy(const QString &spaceId); };