mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 14:32:15 -07:00
Rename method
This commit is contained in:
parent
0ce1281eca
commit
db22ad5ce0
3 changed files with 5 additions and 6 deletions
|
|
@ -148,7 +148,7 @@ void PictureLoaderWorker::handleImageLoadEnqueued(const CardInfoPtr &card)
|
||||||
// try to load image from local first
|
// try to load image from local first
|
||||||
QImage image = localLoader->tryLoad(card);
|
QImage image = localLoader->tryLoad(card);
|
||||||
if (!image.isNull()) {
|
if (!image.isNull()) {
|
||||||
imageLoadedSuccessfully(card, image);
|
handleImageLoaded(card, image);
|
||||||
} else {
|
} else {
|
||||||
// queue up to load image from remote only after local loading failed
|
// queue up to load image from remote only after local loading failed
|
||||||
new PictureLoaderWorkerWork(this, card);
|
new PictureLoaderWorkerWork(this, card);
|
||||||
|
|
@ -156,10 +156,9 @@ void PictureLoaderWorker::handleImageLoadEnqueued(const CardInfoPtr &card)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when image loading is done
|
* Called when image loading is done. Failures are indicated by an empty QImage.
|
||||||
* Contrary to the name, this is called on both success and failure. Failures are indicated by an empty QImage.
|
|
||||||
*/
|
*/
|
||||||
void PictureLoaderWorker::imageLoadedSuccessfully(const CardInfoPtr &card, const QImage &image)
|
void PictureLoaderWorker::handleImageLoaded(const CardInfoPtr &card, const QImage &image)
|
||||||
{
|
{
|
||||||
currentlyLoading.remove(card);
|
currentlyLoading.remove(card);
|
||||||
emit imageLoaded(card, image);
|
emit imageLoaded(card, image);
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ public slots:
|
||||||
QNetworkReply *makeRequest(const QUrl &url, PictureLoaderWorkerWork *workThread);
|
QNetworkReply *makeRequest(const QUrl &url, PictureLoaderWorkerWork *workThread);
|
||||||
void processQueuedRequests();
|
void processQueuedRequests();
|
||||||
bool processSingleRequest();
|
bool processSingleRequest();
|
||||||
void imageLoadedSuccessfully(const CardInfoPtr &card, const QImage &image);
|
void handleImageLoaded(const CardInfoPtr &card, const QImage &image);
|
||||||
void cacheRedirect(const QUrl &originalUrl, const QUrl &redirectUrl);
|
void cacheRedirect(const QUrl &originalUrl, const QUrl &redirectUrl);
|
||||||
void removedCachedUrl(const QUrl &url);
|
void removedCachedUrl(const QUrl &url);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ PictureLoaderWorkerWork::PictureLoaderWorkerWork(const PictureLoaderWorker *work
|
||||||
connect(this, &PictureLoaderWorkerWork::requestImageDownload, worker, &PictureLoaderWorker::queueRequest);
|
connect(this, &PictureLoaderWorkerWork::requestImageDownload, worker, &PictureLoaderWorker::queueRequest);
|
||||||
connect(this, &PictureLoaderWorkerWork::urlRedirected, worker, &PictureLoaderWorker::cacheRedirect);
|
connect(this, &PictureLoaderWorkerWork::urlRedirected, worker, &PictureLoaderWorker::cacheRedirect);
|
||||||
connect(this, &PictureLoaderWorkerWork::cachedUrlInvalidated, worker, &PictureLoaderWorker::removedCachedUrl);
|
connect(this, &PictureLoaderWorkerWork::cachedUrlInvalidated, worker, &PictureLoaderWorker::removedCachedUrl);
|
||||||
connect(this, &PictureLoaderWorkerWork::imageLoaded, worker, &PictureLoaderWorker::imageLoadedSuccessfully);
|
connect(this, &PictureLoaderWorkerWork::imageLoaded, worker, &PictureLoaderWorker::handleImageLoaded);
|
||||||
|
|
||||||
// Hook up signals to settings
|
// Hook up signals to settings
|
||||||
connect(&SettingsCache::instance(), SIGNAL(picDownloadChanged()), this, SLOT(picDownloadChanged()));
|
connect(&SettingsCache::instance(), SIGNAL(picDownloadChanged()), this, SLOT(picDownloadChanged()));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue