diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-12-21 15:57:46 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-12-21 15:57:46 +0100 |
commit | 1ea9dc469b3052abcb4af02017f1d09e74940426 (patch) | |
tree | c06dce3e4b3c255b07c1bd4468b6306c9e0ea17b /src/BlurhashProvider.h | |
parent | Cleanup jdenticon code in the same way as blurhashes (diff) | |
download | nheko-1ea9dc469b3052abcb4af02017f1d09e74940426.tar.xz |
Use global threadpool
Diffstat (limited to 'src/BlurhashProvider.h')
-rw-r--r-- | src/BlurhashProvider.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/BlurhashProvider.h b/src/BlurhashProvider.h index 73b95eee..7f6f31c9 100644 --- a/src/BlurhashProvider.h +++ b/src/BlurhashProvider.h @@ -34,12 +34,12 @@ private: class BlurhashResponse : public QQuickImageResponse { public: - BlurhashResponse(const QString &id, const QSize &requestedSize, QThreadPool *pool) + BlurhashResponse(const QString &id, const QSize &requestedSize) { auto runnable = new BlurhashRunnable(id, requestedSize); connect(runnable, &BlurhashRunnable::done, this, &BlurhashResponse::handleDone); connect(runnable, &BlurhashRunnable::error, this, &BlurhashResponse::handleError); - pool->start(runnable); + QThreadPool::globalInstance()->start(runnable); } QQuickTextureFactory *textureFactory() const override @@ -72,9 +72,6 @@ public slots: QQuickImageResponse * requestImageResponse(const QString &id, const QSize &requestedSize) override { - return new BlurhashResponse(id, requestedSize, &pool); + return new BlurhashResponse(id, requestedSize); } - -private: - QThreadPool pool; }; |