aboutsummaryrefslogtreecommitdiff
path: root/events/eventcontent.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-01-14 18:32:26 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-01-15 09:33:35 +0900
commit525be6dce815f88ed9cc97480bff461741665e8f (patch)
tree7f099b7b50b4854ac57a5bdd6212fb335b95c5e8 /events/eventcontent.cpp
parent93b170ceaced07a3de64708094bb68303a3d4440 (diff)
downloadlibquotient-525be6dce815f88ed9cc97480bff461741665e8f.tar.gz
libquotient-525be6dce815f88ed9cc97480bff461741665e8f.zip
EventContent: rewrite without mixins
MSVC is not good at dealing with type parameter packs of member functions, which is what the whole mixin magic in UrlBasedContent<> relied on. So it's one more level of inheritance instead of mixins now.
Diffstat (limited to 'events/eventcontent.cpp')
-rw-r--r--events/eventcontent.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/events/eventcontent.cpp b/events/eventcontent.cpp
index 271669e2..c96da9b3 100644
--- a/events/eventcontent.cpp
+++ b/events/eventcontent.cpp
@@ -74,15 +74,13 @@ void ImageInfo::fillInfoJson(QJsonObject* infoJson) const
infoJson->insert("h", imageSize.height());
}
-WithThumbnail::WithThumbnail(const QJsonObject& infoJson)
- : thumbnail(infoJson["thumbnail_url"].toString(),
- infoJson["thumbnail_info"].toObject())
+Thumbnail::Thumbnail(const QJsonObject& infoJson)
+ : ImageInfo(infoJson["thumbnail_url"].toString(),
+ infoJson["thumbnail_info"].toObject())
{ }
-void WithThumbnail::fillInfoJson(QJsonObject* infoJson) const
+void Thumbnail::fillInfoJson(QJsonObject* infoJson) const
{
- infoJson->insert("thumbnail_url", thumbnail.url.toString());
- QJsonObject thumbnailInfoJson;
- thumbnail.fillInfoJson(&thumbnailInfoJson);
- infoJson->insert("thumbnail_info", thumbnailInfoJson);
+ infoJson->insert("thumbnail_url", url.toString());
+ infoJson->insert("thumbnail_info", toInfoJson<ImageInfo>(*this));
}