Get rid of threadpool for images
This commit is contained in:
parent
868342ffc9
commit
30791f7890
3 changed files with 48 additions and 21 deletions
|
|
@ -43,9 +43,7 @@ MxcImageProvider::requestImageResponse(const QString &id, const QSize &requested
|
|||
}
|
||||
}
|
||||
|
||||
MxcImageResponse *response = new MxcImageResponse(id_, crop, radius, requestedSize);
|
||||
pool.start(response);
|
||||
return response;
|
||||
return new MxcImageResponse(id_, crop, radius, requestedSize);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -54,18 +52,18 @@ MxcImageProvider::addEncryptionInfo(mtx::crypto::EncryptedFile info)
|
|||
infos.insert(QString::fromStdString(info.url), info);
|
||||
}
|
||||
void
|
||||
MxcImageResponse::run()
|
||||
MxcImageRunnable::run()
|
||||
{
|
||||
MxcImageProvider::download(
|
||||
m_id,
|
||||
m_requestedSize,
|
||||
[this](QString, QSize, QImage image, QString) {
|
||||
if (image.isNull()) {
|
||||
m_error = "Failed to download image.";
|
||||
emit error("Failed to download image.");
|
||||
} else {
|
||||
m_image = image;
|
||||
emit done(image);
|
||||
}
|
||||
emit finished();
|
||||
this->deleteLater();
|
||||
},
|
||||
m_crop,
|
||||
m_radius);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue