diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-12-26 10:57:50 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-12-26 12:40:39 +0900 |
commit | 241f7165816624da45fca58578885b17589ec1f7 (patch) | |
tree | 50c69813eea68ab8d224abe8c78fb9907a9729d7 /lib | |
parent | 5e85dba348676009b2e3b1e41ce9d3e7b8bca1ca (diff) | |
download | libquotient-241f7165816624da45fca58578885b17589ec1f7.tar.gz libquotient-241f7165816624da45fca58578885b17589ec1f7.zip |
EventContent: allow empty (default-constructed) thumbnails
Diffstat (limited to 'lib')
-rw-r--r-- | lib/events/eventcontent.h | 12 |
1 files changed, 5 insertions, 7 deletions
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<InfoT>(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<InfoT> { public: - // TODO: POD constructor + using UrlBasedContent<InfoT>::UrlBasedContent; explicit UrlWithThumbnailContent(const QJsonObject& json) : UrlBasedContent<InfoT>(json) , thumbnail(InfoT::originalInfoJson) |