diff options
Diffstat (limited to 'core/imagedownloader.cpp')
-rw-r--r-- | core/imagedownloader.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/core/imagedownloader.cpp b/core/imagedownloader.cpp index 9a8463b7e..42ab52f0f 100644 --- a/core/imagedownloader.cpp +++ b/core/imagedownloader.cpp @@ -42,11 +42,9 @@ bool ImageDownloader::loadFromUrl(const QUrl &url) QNetworkRequest request(url); connect(&manager, &QNetworkAccessManager::finished, this, [this,&success] (QNetworkReply *reply) { saveImage(reply, success); }); + connect(&manager, &QNetworkAccessManager::finished, &loop, &QEventLoop::quit); QNetworkReply *reply = manager.get(request); - while (reply->isRunning()) { - loop.processEvents(); - sleep(1); - } + loop.exec(); delete reply; } return success; |