aboutsummaryrefslogtreecommitdiff
path: root/jobs
diff options
context:
space:
mode:
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();