aboutsummaryrefslogtreecommitdiff
path: root/events/eventcontent.cpp
diff options
context:
space:
mode:
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));
}