emit cachedImageHit first

This commit is contained in:
RickyRister 2025-07-03 01:05:49 -07:00
parent c103580f8d
commit 935a3a0308

View file

@ -98,12 +98,11 @@ void PictureLoaderWorkerWork::handleNetworkReply(QNetworkReply *reply)
if (reply->error()) { if (reply->error()) {
handleFailedReply(reply); handleFailedReply(reply);
} else { } else {
handleSuccessfulReply(reply);
// If we hit a cached image, we get to make another request for free.
if (reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool()) { if (reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool()) {
emit cachedImageHit(); emit cachedImageHit();
} }
handleSuccessfulReply(reply);
} }
reply->deleteLater(); reply->deleteLater();