aboutsummaryrefslogtreecommitdiff
path: root/events/eventcontent.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-01-26 09:00:33 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-01-26 09:00:33 +0900
commit76bff84a2aa63db677044cc529b910768fa018fa (patch)
treeefeb34e37b436267313169a1790e45a07e8f7fcb /events/eventcontent.cpp
parent7d506f7bebbcc3b5f8a37589f8fda6fa1e7e1efd (diff)
parent2f83e4be20a15013181c1ba6944e21f051ccac9d (diff)
downloadlibquotient-76bff84a2aa63db677044cc529b910768fa018fa.tar.gz
libquotient-76bff84a2aa63db677044cc529b910768fa018fa.zip
Merge branch 'master' into kitsune-gtad
Diffstat (limited to 'events/eventcontent.cpp')
-rw-r--r--events/eventcontent.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/events/eventcontent.cpp b/events/eventcontent.cpp
index 271669e2..f5974b46 100644
--- a/events/eventcontent.cpp
+++ b/events/eventcontent.cpp
@@ -44,7 +44,6 @@ FileInfo::FileInfo(const QUrl& u, const QJsonObject& infoJson,
, payloadSize(infoJson["size"].toInt())
, originalName(originalFilename)
{
- originalInfoJson.insert("mediaId", url.authority() + url.path());
if (!mimeType.isValid())
mimeType = QMimeDatabase().mimeTypeForData(QByteArray());
}
@@ -74,15 +73,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));
}