mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
[PictureLoader] Remove manual multithreading (#6078)
This commit is contained in:
parent
03b216a6b4
commit
f31d30bf84
3 changed files with 2 additions and 12 deletions
|
|
@ -94,7 +94,7 @@ QNetworkReply *PictureLoaderWorker::makeRequest(const QUrl &url, PictureLoaderWo
|
|||
QNetworkReply *reply = networkManager->get(req);
|
||||
|
||||
// Connect reply handling
|
||||
connect(reply, &QNetworkReply::finished, worker, [reply, worker] { worker->acceptNetworkReply(reply); });
|
||||
connect(reply, &QNetworkReply::finished, worker, [reply, worker] { worker->handleNetworkReply(reply); });
|
||||
|
||||
return reply;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,15 +70,6 @@ void PictureLoaderWorkerWork::picDownloadFailed()
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the reply in another thread.
|
||||
* @param reply The finished reply. Takes ownership of the object
|
||||
*/
|
||||
void PictureLoaderWorkerWork::acceptNetworkReply(QNetworkReply *reply)
|
||||
{
|
||||
QThreadPool::globalInstance()->start([this, reply] { handleNetworkReply(reply); });
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param reply The reply. Takes ownership of the object
|
||||
|
|
|
|||
|
|
@ -30,14 +30,13 @@ public:
|
|||
PictureToLoad cardToDownload;
|
||||
|
||||
public slots:
|
||||
void acceptNetworkReply(QNetworkReply *reply);
|
||||
void handleNetworkReply(QNetworkReply *reply);
|
||||
|
||||
private:
|
||||
bool picDownload;
|
||||
|
||||
void startNextPicDownload();
|
||||
void picDownloadFailed();
|
||||
void handleNetworkReply(QNetworkReply *reply);
|
||||
void handleFailedReply(const QNetworkReply *reply);
|
||||
void handleSuccessfulReply(QNetworkReply *reply);
|
||||
QImage tryLoadImageFromReply(QNetworkReply *reply);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue