aboutsummaryrefslogtreecommitdiff
path: root/lib/events/eventcontent.cpp
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-01-04 12:46:34 +0100
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-05-08 17:43:58 +0200
commit09ecce1744344f1bfbacd31c8f300440a4139be4 (patch)
tree85c7993cf517a1328f5ae82892d29cdb1f9aba40 /lib/events/eventcontent.cpp
parentb094a75f704b59f1382b6eec1f3bf0ab51fb0a85 (diff)
downloadlibquotient-09ecce1744344f1bfbacd31c8f300440a4139be4.tar.gz
libquotient-09ecce1744344f1bfbacd31c8f300440a4139be4.zip
Cleanup; comments reformatting
Diffstat (limited to 'lib/events/eventcontent.cpp')
-rw-r--r--lib/events/eventcontent.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/events/eventcontent.cpp b/lib/events/eventcontent.cpp
index 9d7edf20..479d5da0 100644
--- a/lib/events/eventcontent.cpp
+++ b/lib/events/eventcontent.cpp
@@ -29,12 +29,13 @@ FileInfo::FileInfo(const QFileInfo &fi)
}
FileInfo::FileInfo(QUrl u, qint64 payloadSize, const QMimeType& mimeType,
- Omittable<EncryptedFile> file, QString originalFilename)
+ Omittable<EncryptedFile> encryptedFile,
+ QString originalFilename)
: mimeType(mimeType)
, url(move(u))
, payloadSize(payloadSize)
, originalName(move(originalFilename))
- , file(file)
+ , file(move(encryptedFile))
{
if (!isValid())
qCWarning(MESSAGES)
@@ -44,7 +45,7 @@ FileInfo::FileInfo(QUrl u, qint64 payloadSize, const QMimeType& mimeType,
}
FileInfo::FileInfo(QUrl mxcUrl, const QJsonObject& infoJson,
- const Omittable<EncryptedFile> &file,
+ Omittable<EncryptedFile> encryptedFile,
QString originalFilename)
: originalInfoJson(infoJson)
, mimeType(
@@ -52,7 +53,7 @@ FileInfo::FileInfo(QUrl mxcUrl, const QJsonObject& infoJson,
, url(move(mxcUrl))
, payloadSize(fromJson<qint64>(infoJson["size"_ls]))
, originalName(move(originalFilename))
- , file(file)
+ , file(move(encryptedFile))
{
if(url.isEmpty() && file.has_value()) {
url = file->url;
@@ -82,15 +83,16 @@ ImageInfo::ImageInfo(const QFileInfo& fi, QSize imageSize)
{}
ImageInfo::ImageInfo(const QUrl& mxcUrl, qint64 fileSize, const QMimeType& type,
- QSize imageSize, const Omittable<EncryptedFile> &file, const QString& originalFilename)
- : FileInfo(mxcUrl, fileSize, type, file, originalFilename)
+ QSize imageSize, Omittable<EncryptedFile> encryptedFile,
+ const QString& originalFilename)
+ : FileInfo(mxcUrl, fileSize, type, move(encryptedFile), originalFilename)
, imageSize(imageSize)
{}
ImageInfo::ImageInfo(const QUrl& mxcUrl, const QJsonObject& infoJson,
- const Omittable<EncryptedFile> &file,
+ Omittable<EncryptedFile> encryptedFile,
const QString& originalFilename)
- : FileInfo(mxcUrl, infoJson, file, originalFilename)
+ : FileInfo(mxcUrl, infoJson, move(encryptedFile), originalFilename)
, imageSize(infoJson["w"_ls].toInt(), infoJson["h"_ls].toInt())
{}
@@ -103,10 +105,10 @@ void ImageInfo::fillInfoJson(QJsonObject* infoJson) const
infoJson->insert(QStringLiteral("h"), imageSize.height());
}
-Thumbnail::Thumbnail(const QJsonObject& infoJson, const Omittable<EncryptedFile> &file)
+Thumbnail::Thumbnail(const QJsonObject& infoJson,
+ Omittable<EncryptedFile> encryptedFile)
: ImageInfo(QUrl(infoJson["thumbnail_url"_ls].toString()),
- infoJson["thumbnail_info"_ls].toObject(),
- file)
+ infoJson["thumbnail_info"_ls].toObject(), move(encryptedFile))
{}
void Thumbnail::fillInfoJson(QJsonObject* infoJson) const