aboutsummaryrefslogtreecommitdiff
path: root/jobs/mediathumbnailjob.cpp
diff options
context:
space:
mode:
authorFelix Rohrbach <fxrh@gmx.de>2016-10-14 16:58:06 +0200
committerGitHub <noreply@github.com>2016-10-14 16:58:06 +0200
commit6536124821c1df791a69a58de21a71322d9363f6 (patch)
tree712be9dc1f146105c5569dfac65367381f260793 /jobs/mediathumbnailjob.cpp
parent45f38a1d6687d1ceaca87a6d6d94ac2515debb02 (diff)
parent24deeda0fe95fd352b823b48a3bc2e660f6a261d (diff)
downloadlibquotient-6536124821c1df791a69a58de21a71322d9363f6.tar.gz
libquotient-6536124821c1df791a69a58de21a71322d9363f6.zip
Merge pull request #42 from Fxrh/kitsune-use-qsize
MediaThumbnailJob: Use QSize instead of two separate int's for size
Diffstat (limited to 'jobs/mediathumbnailjob.cpp')
-rw-r--r--jobs/mediathumbnailjob.cpp12
1 files changed, 5 insertions, 7 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