From 24deeda0fe95fd352b823b48a3bc2e660f6a261d Mon Sep 17 00:00:00 2001 From: Kitsune Ral Date: Fri, 14 Oct 2016 10:06:44 +0900 Subject: MediaThumbnailJob: Use QSize instead of two separate int's for size Connection::getThumbnail() is now overloaded to provide compatibility with the previous interface. --- jobs/mediathumbnailjob.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'jobs/mediathumbnailjob.cpp') 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 -- cgit v1.2.3