aboutsummaryrefslogtreecommitdiff
path: root/jobs/mediathumbnailjob.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'jobs/mediathumbnailjob.cpp')
-rw-r--r--jobs/mediathumbnailjob.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/jobs/mediathumbnailjob.cpp b/jobs/mediathumbnailjob.cpp
index d768d253..ec82f57b 100644
--- a/jobs/mediathumbnailjob.cpp
+++ b/jobs/mediathumbnailjob.cpp
@@ -20,8 +20,15 @@
using namespace QMatrixClient;
-MediaThumbnailJob::MediaThumbnailJob(QUrl url, QSize requestedSize)
- : GetContentThumbnailJob(url.host(), url.path().mid(1),
+MediaThumbnailJob::MediaThumbnailJob(const QString& serverName,
+ const QString& mediaId, QSize requestedSize)
+ : GetContentThumbnailJob(serverName, mediaId,
+ requestedSize.width(), requestedSize.height())
+{ }
+
+MediaThumbnailJob::MediaThumbnailJob(const QUrl& mxcUri, QSize requestedSize)
+ : GetContentThumbnailJob(mxcUri.authority(),
+ mxcUri.path().mid(1), // sans leading '/'
requestedSize.width(), requestedSize.height())
{ }
@@ -39,7 +46,7 @@ QImage MediaThumbnailJob::scaledThumbnail(QSize toSize) const
BaseJob::Status MediaThumbnailJob::parseReply(QNetworkReply* reply)
{
GetContentThumbnailJob::parseReply(reply);
- if( !_thumbnail.loadFromData(content()) )
+ if( !_thumbnail.loadFromData(content()->readAll()) )
{
qCDebug(JOBS) << "MediaThumbnailJob: could not read image data";
}