aboutsummaryrefslogtreecommitdiff
path: root/jobs
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2016-10-14 10:06:44 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2016-10-14 10:06:44 +0900
commit24deeda0fe95fd352b823b48a3bc2e660f6a261d (patch)
tree712be9dc1f146105c5569dfac65367381f260793 /jobs
parent45f38a1d6687d1ceaca87a6d6d94ac2515debb02 (diff)
downloadlibquotient-24deeda0fe95fd352b823b48a3bc2e660f6a261d.tar.gz
libquotient-24deeda0fe95fd352b823b48a3bc2e660f6a261d.zip
MediaThumbnailJob: Use QSize instead of two separate int's for size
Connection::getThumbnail() is now overloaded to provide compatibility with the previous interface.
Diffstat (limited to 'jobs')
-rw-r--r--jobs/mediathumbnailjob.cpp12
-rw-r--r--jobs/mediathumbnailjob.h2
2 files changed, 6 insertions, 8 deletions
diff --git a/jobs/mediathumbnailjob.cpp b/jobs/mediathumbnailjob.cpp
index 8a5dc4ea..975a533d 100644
--- a/jobs/mediathumbnailjob.cpp
+++ b/jobs/mediathumbnailjob.cpp
@@ -27,19 +27,17 @@ class MediaThumbnailJob::Private
public:
QUrl url;
QPixmap thumbnail;
- int requestedHeight;
- int requestedWidth;
+ QSize requestedSize;
ThumbnailType thumbnailType;
};
-MediaThumbnailJob::MediaThumbnailJob(ConnectionData* data, QUrl url, int requestedWidth, int requestedHeight,
+MediaThumbnailJob::MediaThumbnailJob(ConnectionData* data, QUrl url, QSize requestedSize,
ThumbnailType thumbnailType)
: BaseJob(data, JobHttpType::GetJob, "MediaThumbnailJob")
, d(new Private)
{
d->url = url;
- d->requestedHeight = requestedHeight;
- d->requestedWidth = requestedWidth;
+ d->requestedSize = requestedSize;
d->thumbnailType = thumbnailType;
}
@@ -61,8 +59,8 @@ QString MediaThumbnailJob::apiPath() const
QUrlQuery MediaThumbnailJob::query() const
{
QUrlQuery query;
- query.addQueryItem("width", QString::number(d->requestedWidth));
- query.addQueryItem("height", QString::number(d->requestedHeight));
+ query.addQueryItem("width", QString::number(d->requestedSize.width()));
+ query.addQueryItem("height", QString::number(d->requestedSize.height()));
if( d->thumbnailType == ThumbnailType::Scale )
query.addQueryItem("method", "scale");
else
diff --git a/jobs/mediathumbnailjob.h b/jobs/mediathumbnailjob.h
index 3babf845..8a6cdce2 100644
--- a/jobs/mediathumbnailjob.h
+++ b/jobs/mediathumbnailjob.h
@@ -30,7 +30,7 @@ namespace QMatrixClient
class MediaThumbnailJob: public BaseJob
{
public:
- MediaThumbnailJob(ConnectionData* data, QUrl url, int requestedWidth, int requestedHeight,
+ MediaThumbnailJob(ConnectionData* data, QUrl url, QSize requestedSize,
ThumbnailType thumbnailType=ThumbnailType::Scale);
virtual ~MediaThumbnailJob();