diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-06-02 13:32:47 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-06-02 13:32:47 +0900 |
commit | 0dd491fbd189baaabadcab2344a05e3cf3898287 (patch) | |
tree | 13b8ebe63ba8b156ddd6ddab8b0ad2845d7c9c42 /lib/csapi/content-repo.h | |
parent | e7ac6f3480358fd989c8a3090590d665d18e1cec (diff) | |
download | libquotient-0dd491fbd189baaabadcab2344a05e3cf3898287.tar.gz libquotient-0dd491fbd189baaabadcab2344a05e3cf3898287.zip |
csapi: Use Omittable<> container instead of intrusive 'omitted' field
Also: use the latest feature of GTAD, +set/+on, to make gtad.yaml more compact.
Diffstat (limited to 'lib/csapi/content-repo.h')
-rw-r--r-- | lib/csapi/content-repo.h | 11 |
1 files changed, 6 insertions, 5 deletions
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 <QtCore/QIODevice> 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<int> width = none, Omittable<int> 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<int> width = none, Omittable<int> 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<qint64> 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<qint64> ts = none); ~GetUrlPreviewJob() override; // Result properties - qint64 matrixImageSize() const; + Omittable<qint64> matrixImageSize() const; const QString& ogImage() const; protected: |