From 0dd491fbd189baaabadcab2344a05e3cf3898287 Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Sat, 2 Jun 2018 13:32:47 +0900 Subject: csapi: Use Omittable<> container instead of intrusive 'omitted' field Also: use the latest feature of GTAD, +set/+on, to make gtad.yaml more compact. --- lib/csapi/content-repo.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/csapi/content-repo.h') diff --git a/lib/csapi/content-repo.h b/lib/csapi/content-repo.h index 63a55c8f..8d73dc51 100644 --- a/lib/csapi/content-repo.h +++ b/lib/csapi/content-repo.h @@ -6,6 +6,7 @@ #include "jobs/basejob.h" +#include "converters.h" #include namespace QMatrixClient @@ -89,14 +90,14 @@ namespace QMatrixClient class GetContentThumbnailJob : public BaseJob { public: - explicit GetContentThumbnailJob(const QString& serverName, const QString& mediaId, int width = {}, int height = {}, const QString& method = {}); + explicit GetContentThumbnailJob(const QString& serverName, const QString& mediaId, Omittable width = none, Omittable height = none, const QString& method = {}); /** Construct a URL out of baseUrl and usual parameters passed to * GetContentThumbnailJob. This function can be used when * a URL for GetContentThumbnailJob is necessary but the job * itself isn't. */ - static QUrl makeRequestUrl(QUrl baseUrl, const QString& serverName, const QString& mediaId, int width = {}, int height = {}, const QString& method = {}); + static QUrl makeRequestUrl(QUrl baseUrl, const QString& serverName, const QString& mediaId, Omittable width = none, Omittable height = none, const QString& method = {}); ~GetContentThumbnailJob() override; @@ -116,20 +117,20 @@ namespace QMatrixClient class GetUrlPreviewJob : public BaseJob { public: - explicit GetUrlPreviewJob(const QString& url, qint64 ts = {}); + explicit GetUrlPreviewJob(const QString& url, Omittable ts = none); /** Construct a URL out of baseUrl and usual parameters passed to * GetUrlPreviewJob. This function can be used when * a URL for GetUrlPreviewJob is necessary but the job * itself isn't. */ - static QUrl makeRequestUrl(QUrl baseUrl, const QString& url, qint64 ts = {}); + static QUrl makeRequestUrl(QUrl baseUrl, const QString& url, Omittable ts = none); ~GetUrlPreviewJob() override; // Result properties - qint64 matrixImageSize() const; + Omittable matrixImageSize() const; const QString& ogImage() const; protected: -- cgit v1.2.3