Fix missing pSize.

This commit is contained in:
Black Hat 2018-08-28 11:12:49 +08:00
parent 3fa14d3c4b
commit a8d12f92bd
1 changed files with 6 additions and 3 deletions

View File

@ -34,11 +34,14 @@ QImage ImageProvider::requestImage(const QString& id, QSize* pSize,
QUrl tempfilePath = QUrl::fromLocalFile( QUrl tempfilePath = QUrl::fromLocalFile(
QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/" + QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/" +
mxcUri.fileName() + "-" + QString::number(requestedSize.width()) + mxcUri.fileName() + "-" + QString::number(requestedSize.width()) + "x" +
"x" + QString::number(requestedSize.height()) + ".png"); QString::number(requestedSize.height()) + ".png");
QImage cachedImage; QImage cachedImage;
if (cachedImage.load(tempfilePath.toLocalFile())) return cachedImage; if (cachedImage.load(tempfilePath.toLocalFile())) {
if (pSize != nullptr) *pSize = cachedImage.size();
return cachedImage;
}
MediaThumbnailJob* job = nullptr; MediaThumbnailJob* job = nullptr;
QReadLocker locker(&m_lock); QReadLocker locker(&m_lock);