Workarround empty requestedSize in Kirigami Avatar
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
using Quotient::BaseJob;
|
using Quotient::BaseJob;
|
||||||
|
|
||||||
ThumbnailResponse::ThumbnailResponse(Quotient::Connection *c, QString id, const QSize &size)
|
ThumbnailResponse::ThumbnailResponse(Quotient::Connection *c, QString id, QSize size)
|
||||||
: c(c)
|
: c(c)
|
||||||
, mediaId(std::move(id))
|
, mediaId(std::move(id))
|
||||||
, requestedSize(size)
|
, requestedSize(size)
|
||||||
@@ -22,9 +22,8 @@ ThumbnailResponse::ThumbnailResponse(Quotient::Connection *c, QString id, const
|
|||||||
, errorStr("Image request hasn't started")
|
, errorStr("Image request hasn't started")
|
||||||
{
|
{
|
||||||
if (requestedSize.isEmpty()) {
|
if (requestedSize.isEmpty()) {
|
||||||
errorStr.clear();
|
requestedSize.setHeight(100);
|
||||||
Q_EMIT finished();
|
requestedSize.setWidth(100);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (mediaId.count('/') != 1) {
|
if (mediaId.count('/') != 1) {
|
||||||
errorStr = tr("Media id '%1' doesn't follow server/mediaId pattern").arg(mediaId);
|
errorStr = tr("Media id '%1' doesn't follow server/mediaId pattern").arg(mediaId);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class ThumbnailResponse : public QQuickImageResponse
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
ThumbnailResponse(Quotient::Connection *c, QString mediaId, const QSize &requestedSize);
|
ThumbnailResponse(Quotient::Connection *c, QString mediaId, QSize requestedSize);
|
||||||
~ThumbnailResponse() override = default;
|
~ThumbnailResponse() override = default;
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
@@ -36,7 +36,7 @@ private Q_SLOTS:
|
|||||||
private:
|
private:
|
||||||
Quotient::Connection *c;
|
Quotient::Connection *c;
|
||||||
const QString mediaId;
|
const QString mediaId;
|
||||||
const QSize requestedSize;
|
QSize requestedSize;
|
||||||
const QString localFile;
|
const QString localFile;
|
||||||
Quotient::MediaThumbnailJob *job = nullptr;
|
Quotient::MediaThumbnailJob *job = nullptr;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user