From ece56a55e81ced388f33f6c440a8af4bea48be13 Mon Sep 17 00:00:00 2001 From: James Graham Date: Sun, 5 May 2024 17:09:25 +0100 Subject: [PATCH] handle remaining stuff for Quotient::Omittable deprecation --- src/eventhandler.cpp | 4 ++-- src/events/imagepackevent.cpp | 4 ++-- src/models/searchmodel.cpp | 4 ++-- src/registration.cpp | 4 ++-- src/spacehierarchycache.cpp | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/eventhandler.cpp b/src/eventhandler.cpp index ca42438b1..de11e709f 100644 --- a/src/eventhandler.cpp +++ b/src/eventhandler.cpp @@ -255,7 +255,7 @@ QString EventHandler::rawMessageBody(const Quotient::RoomMessageEvent &event) QString body; if (event.hasTextContent() && event.content()) { - body = static_cast(event.content())->body; + body = static_cast(event.content())->body; } else { body = event.plainBody(); } @@ -479,7 +479,7 @@ QString EventHandler::getMessageBody(const RoomMessageEvent &event, Qt::TextForm QString body; if (event.hasTextContent() && event.content()) { - body = static_cast(event.content())->body; + body = static_cast(event.content())->body; } else { body = event.plainBody(); } diff --git a/src/events/imagepackevent.cpp b/src/events/imagepackevent.cpp index 2fd2977bd..ae892fd13 100644 --- a/src/events/imagepackevent.cpp +++ b/src/events/imagepackevent.cpp @@ -16,7 +16,7 @@ ImagePackEventContent::ImagePackEventContent(const QJsonObject &json) fromJson>(json["pack"_ls].toObject()["attribution"_ls]), }; } else { - pack = none; + pack = std::nullopt; } const auto &keys = json["images"_ls].toObject().keys(); @@ -25,7 +25,7 @@ ImagePackEventContent::ImagePackEventContent(const QJsonObject &json) if (json["images"_ls][k].toObject().contains(QStringLiteral("info"))) { info = EventContent::ImageInfo(QUrl(json["images"_ls][k]["url"_ls].toString()), json["images"_ls][k]["info"_ls].toObject(), k); } else { - info = none; + info = std::nullopt; } images += ImagePackImage{ k, diff --git a/src/models/searchmodel.cpp b/src/models/searchmodel.cpp index b92a68faf..0a7f705bd 100644 --- a/src/models/searchmodel.cpp +++ b/src/models/searchmodel.cpp @@ -44,7 +44,7 @@ void SearchModel::search() } RoomEventFilter filter; - filter.unreadThreadNotifications = none; + filter.unreadThreadNotifications = std::nullopt; filter.lazyLoadMembers = true; filter.includeRedundantMembers = false; filter.notRooms = QStringList(); @@ -58,7 +58,7 @@ void SearchModel::search() .orderBy = "recent"_ls, .eventContext = SearchJob::IncludeEventContext{3, 3, true}, .includeState = false, - .groupings = none, + .groupings = std::nullopt, }; diff --git a/src/registration.cpp b/src/registration.cpp index 11303cf9f..da25fa92d 100644 --- a/src/registration.cpp +++ b/src/registration.cpp @@ -63,7 +63,7 @@ QString Registration::recaptchaSiteKey() const void Registration::registerAccount() { setStatus(Working); - std::optional authData = none; + std::optional authData = std::nullopt; if (nextStep() == "m.login.recaptcha"_ls) { authData = QJsonObject{ {"type"_ls, "m.login.recaptcha"_ls}, @@ -176,7 +176,7 @@ void Registration::testHomeserver() if (m_testServerJob) { delete m_testServerJob; } - m_testServerJob = m_connection->callApi("user"_ls, none, "user"_ls, QString(), QString(), QString(), false); + m_testServerJob = m_connection->callApi("user"_ls, std::nullopt, "user"_ls, QString(), QString(), QString(), false); connect(m_testServerJob.data(), &BaseJob::finished, this, [this]() { if (m_testServerJob->error() == BaseJob::StatusCode::ContentAccessError) { setStatus(ServerNoRegistration); diff --git a/src/spacehierarchycache.cpp b/src/spacehierarchycache.cpp index 180ea5804..2d688d6f6 100644 --- a/src/spacehierarchycache.cpp +++ b/src/spacehierarchycache.cpp @@ -57,7 +57,7 @@ void SpaceHierarchyCache::populateSpaceHierarchy(const QString &spaceId) } m_nextBatchTokens[spaceId] = QString(); - auto job = m_connection->callApi(spaceId, none, none, none, *m_nextBatchTokens[spaceId]); + auto job = m_connection->callApi(spaceId, std::nullopt, std::nullopt, std::nullopt, *m_nextBatchTokens[spaceId]); auto group = KConfigGroup(KSharedConfig::openStateConfig("SpaceHierarchy"_ls), "Cache"_ls); m_spaceHierarchy.insert(spaceId, group.readEntry(spaceId, QStringList())); @@ -86,7 +86,7 @@ void SpaceHierarchyCache::addBatch(const QString &spaceId, Quotient::GetSpaceHie const auto nextBatchToken = job->nextBatch(); if (!nextBatchToken.isEmpty() && nextBatchToken != *m_nextBatchTokens[spaceId]) { *m_nextBatchTokens[spaceId] = nextBatchToken; - auto nextJob = m_connection->callApi(spaceId, none, none, none, *m_nextBatchTokens[spaceId]); + auto nextJob = m_connection->callApi(spaceId, std::nullopt, std::nullopt, std::nullopt, *m_nextBatchTokens[spaceId]); connect(nextJob, &BaseJob::success, this, [this, nextJob, spaceId]() { addBatch(spaceId, nextJob); });