From 241f7165816624da45fca58578885b17589ec1f7 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Wed, 26 Dec 2018 10:57:50 +0900 Subject: EventContent: allow empty (default-constructed) thumbnails --- lib/events/eventcontent.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'lib/events/eventcontent.h') diff --git a/lib/events/eventcontent.h b/lib/events/eventcontent.h index bedf0078..ea321fb6 100644 --- a/lib/events/eventcontent.h +++ b/lib/events/eventcontent.h @@ -149,10 +149,10 @@ namespace QMatrixClient class Thumbnail : public ImageInfo { public: + Thumbnail() : ImageInfo(QUrl()) { } // To allow empty thumbnails Thumbnail(const QJsonObject& infoJson); - Thumbnail(const ImageInfo& info) - : ImageInfo(info) - { } + Thumbnail(const ImageInfo& info) : ImageInfo(info) { } + using ImageInfo::ImageInfo; /** * Writes thumbnail information to "thumbnail_info" subobject @@ -184,9 +184,7 @@ namespace QMatrixClient class UrlBasedContent : public TypedBase, public InfoT { public: - UrlBasedContent(QUrl url, InfoT&& info, QString filename = {}) - : InfoT(url, std::forward(info), filename) - { } + using InfoT::InfoT; explicit UrlBasedContent(const QJsonObject& json) : TypedBase(json) , InfoT(json["url"].toString(), json["info"].toObject(), @@ -214,7 +212,7 @@ namespace QMatrixClient class UrlWithThumbnailContent : public UrlBasedContent { public: - // TODO: POD constructor + using UrlBasedContent::UrlBasedContent; explicit UrlWithThumbnailContent(const QJsonObject& json) : UrlBasedContent(json) , thumbnail(InfoT::originalInfoJson) -- cgit v1.2.3