aboutsummaryrefslogtreecommitdiff
path: root/lib/jobs/mediathumbnailjob.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/jobs/mediathumbnailjob.cpp')
-rw-r--r--lib/jobs/mediathumbnailjob.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/lib/jobs/mediathumbnailjob.cpp b/lib/jobs/mediathumbnailjob.cpp
index aeb49839..d3370f1f 100644
--- a/lib/jobs/mediathumbnailjob.cpp
+++ b/lib/jobs/mediathumbnailjob.cpp
@@ -13,41 +13,42 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "mediathumbnailjob.h"
using namespace QMatrixClient;
-QUrl MediaThumbnailJob::makeRequestUrl(QUrl baseUrl,
- const QUrl& mxcUri, QSize requestedSize)
+QUrl MediaThumbnailJob::makeRequestUrl(QUrl baseUrl, const QUrl& mxcUri,
+ QSize requestedSize)
{
- return makeRequestUrl(std::move(baseUrl),
- mxcUri.authority(), mxcUri.path().mid(1),
- requestedSize.width(), requestedSize.height());
+ return makeRequestUrl(std::move(baseUrl), mxcUri.authority(),
+ mxcUri.path().mid(1), requestedSize.width(),
+ requestedSize.height());
}
MediaThumbnailJob::MediaThumbnailJob(const QString& serverName,
- const QString& mediaId, QSize requestedSize)
- : GetContentThumbnailJob(serverName, mediaId,
- requestedSize.width(), requestedSize.height())
-{ }
+ const QString& mediaId,
+ QSize requestedSize)
+ : GetContentThumbnailJob(serverName, mediaId, requestedSize.width(),
+ requestedSize.height())
+{
+}
MediaThumbnailJob::MediaThumbnailJob(const QUrl& mxcUri, QSize requestedSize)
- : MediaThumbnailJob(mxcUri.authority(), mxcUri.path().mid(1), // sans leading '/'
+ : MediaThumbnailJob(mxcUri.authority(),
+ mxcUri.path().mid(1), // sans leading '/'
requestedSize)
-{ }
-
-QImage MediaThumbnailJob::thumbnail() const
{
- return _thumbnail;
}
+QImage MediaThumbnailJob::thumbnail() const { return _thumbnail; }
+
QImage MediaThumbnailJob::scaledThumbnail(QSize toSize) const
{
- return _thumbnail.scaled(toSize,
- Qt::KeepAspectRatio, Qt::SmoothTransformation);
+ return _thumbnail.scaled(toSize, Qt::KeepAspectRatio,
+ Qt::SmoothTransformation);
}
BaseJob::Status MediaThumbnailJob::parseReply(QNetworkReply* reply)
@@ -56,7 +57,7 @@ BaseJob::Status MediaThumbnailJob::parseReply(QNetworkReply* reply)
if (!result.good())
return result;
- if( _thumbnail.loadFromData(data()->readAll()) )
+ if (_thumbnail.loadFromData(data()->readAll()))
return Success;
return { IncorrectResponseError, "Could not read image data" };