diff options
author | David Faure <faure@kde.org> | 2020-11-26 22:32:55 +0100 |
---|---|---|
committer | David Faure <faure@kde.org> | 2020-11-26 22:32:55 +0100 |
commit | 17d6e00597fdc1c8f25808735cbc728c4a6b3506 (patch) | |
tree | f27be06719da60306413cfb62d6eb578d69bdf98 /lib/events | |
parent | 21554bccc39ab2f63869c244ed880686805887cb (diff) | |
download | libquotient-17d6e00597fdc1c8f25808735cbc728c4a6b3506.tar.gz libquotient-17d6e00597fdc1c8f25808735cbc728c4a6b3506.zip |
Enable QT_NO_URL_CAST_FROM_STRING and QT_STRICT_ITERATORS.
* QT_NO_URL_CAST_FROM_STRING makes it clearer where QUrls are created
from QStrings (which incurs a parsing cost).
* QT_STRICT_ITERATORS helps detecting where begin()/end() is used
instead of cbegin()/cend(). KDE developers have verified that
the generated assembly code is identical.
Diffstat (limited to 'lib/events')
-rw-r--r-- | lib/events/eventcontent.cpp | 2 | ||||
-rw-r--r-- | lib/events/eventcontent.h | 2 | ||||
-rw-r--r-- | lib/events/roommemberevent.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/events/eventcontent.cpp b/lib/events/eventcontent.cpp index 802d8176..0cb9e292 100644 --- a/lib/events/eventcontent.cpp +++ b/lib/events/eventcontent.cpp @@ -89,7 +89,7 @@ void ImageInfo::fillInfoJson(QJsonObject* infoJson) const } Thumbnail::Thumbnail(const QJsonObject& infoJson) - : ImageInfo(infoJson["thumbnail_url"_ls].toString(), + : ImageInfo(QUrl(infoJson["thumbnail_url"_ls].toString()), infoJson["thumbnail_info"_ls].toObject()) {} diff --git a/lib/events/eventcontent.h b/lib/events/eventcontent.h index 0d4c047e..9c167d4b 100644 --- a/lib/events/eventcontent.h +++ b/lib/events/eventcontent.h @@ -189,7 +189,7 @@ namespace EventContent { using InfoT::InfoT; explicit UrlBasedContent(const QJsonObject& json) : TypedBase(json) - , InfoT(json["url"].toString(), json["info"].toObject(), + , InfoT(QUrl(json["url"].toString()), json["info"].toObject(), json["filename"].toString()) { // A small hack to facilitate links creation in QML. diff --git a/lib/events/roommemberevent.cpp b/lib/events/roommemberevent.cpp index be47e412..913bde74 100644 --- a/lib/events/roommemberevent.cpp +++ b/lib/events/roommemberevent.cpp @@ -52,7 +52,7 @@ MemberEventContent::MemberEventContent(const QJsonObject& json) : membership(fromJson<MembershipType>(json["membership"_ls])) , isDirect(json["is_direct"_ls].toBool()) , displayName(fromJson<Omittable<QString>>(json["displayname"_ls])) - , avatarUrl(fromJson<Omittable<QUrl>>(json["avatar_url"_ls])) + , avatarUrl(fromJson<Omittable<QString>>(json["avatar_url"_ls])) , reason(json["reason"_ls].toString()) { if (displayName) |