diff --git a/cockatrice/src/client/ui/picture_loader/picture_loader_worker.cpp b/cockatrice/src/client/ui/picture_loader/picture_loader_worker.cpp index d6c26330e..b0ab0b4c0 100644 --- a/cockatrice/src/client/ui/picture_loader/picture_loader_worker.cpp +++ b/cockatrice/src/client/ui/picture_loader/picture_loader_worker.cpp @@ -12,7 +12,6 @@ #include #include - PictureLoaderWorker::PictureLoaderWorker() : QObject(nullptr), picDownload(SettingsCache::instance().getPicDownload()) { networkManager = new QNetworkAccessManager(this); @@ -66,6 +65,7 @@ void PictureLoaderWorker::queueRequest(const QUrl &url, PictureLoaderWorkerWork if (!cachedRedirect.isEmpty()) { queueRequest(cachedRedirect, worker); } else if (cache->metaData(url).isValid()) { + // If we hit a cached url, we get to make the request for free, since it won't contribute towards the rate-limit makeRequest(url, worker); } else { requestLoadQueue.append(qMakePair(url, worker)); diff --git a/cockatrice/src/client/ui/picture_loader/picture_loader_worker_work.cpp b/cockatrice/src/client/ui/picture_loader/picture_loader_worker_work.cpp index 2c3d1ec9e..712f68dc1 100644 --- a/cockatrice/src/client/ui/picture_loader/picture_loader_worker_work.cpp +++ b/cockatrice/src/client/ui/picture_loader/picture_loader_worker_work.cpp @@ -20,7 +20,6 @@ PictureLoaderWorkerWork::PictureLoaderWorkerWork(const PictureLoaderWorker *work { // Hook up signals to the orchestrator connect(this, &PictureLoaderWorkerWork::requestImageDownload, worker, &PictureLoaderWorker::queueRequest); - connect(this, &PictureLoaderWorkerWork::cachedImageHit, worker, &PictureLoaderWorker::processSingleRequest); connect(this, &PictureLoaderWorkerWork::urlRedirected, worker, &PictureLoaderWorker::cacheRedirect); connect(this, &PictureLoaderWorkerWork::cachedUrlInvalidated, worker, &PictureLoaderWorker::removedCachedUrl); connect(this, &PictureLoaderWorkerWork::imageLoaded, worker, &PictureLoaderWorker::imageLoadedSuccessfully); @@ -97,10 +96,6 @@ void PictureLoaderWorkerWork::handleNetworkReply(QNetworkReply *reply) if (reply->error()) { handleFailedReply(reply); } else { - if (reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool()) { - emit cachedImageHit(); - } - handleSuccessfulReply(reply); } diff --git a/cockatrice/src/client/ui/picture_loader/picture_loader_worker_work.h b/cockatrice/src/client/ui/picture_loader/picture_loader_worker_work.h index 62da6bc0b..9e79a72d5 100644 --- a/cockatrice/src/client/ui/picture_loader/picture_loader_worker_work.h +++ b/cockatrice/src/client/ui/picture_loader/picture_loader_worker_work.h @@ -55,10 +55,6 @@ signals: void imageLoaded(CardInfoPtr card, const QImage &image); void requestImageDownload(const QUrl &url, PictureLoaderWorkerWork *instance); - /** - * We hit a cached image from the network cache; we get to make another request for free. - */ - void cachedImageHit(); void urlRedirected(const QUrl &originalUrl, const QUrl &redirectUrl); void cachedUrlInvalidated(const QUrl &url); };