[PictureLoader] Remove manual multithreading

This commit is contained in:
RickyRister 2025-08-15 23:59:30 -07:00
parent 09381575a7
commit 29b0a9d61f
3 changed files with 2 additions and 12 deletions

View file

@ -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;
}

View file

@ -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

View file

@ -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);