From d2eb7079e1fece6001faec7b52c25bca68ef8fd4 Mon Sep 17 00:00:00 2001 From: dirk-de-bugger Date: Thu, 25 May 2017 19:56:06 +0200 Subject: [PATCH] Make ScraperSearchHandle::update() non-blocking and ScraperSearchComponent::search() show the busy animation. --- es-app/src/components/ScraperSearchComponent.cpp | 2 ++ es-app/src/scrapers/Scraper.cpp | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/es-app/src/components/ScraperSearchComponent.cpp b/es-app/src/components/ScraperSearchComponent.cpp index 9cfda3de6..89d954931 100644 --- a/es-app/src/components/ScraperSearchComponent.cpp +++ b/es-app/src/components/ScraperSearchComponent.cpp @@ -205,6 +205,8 @@ void ScraperSearchComponent::updateViewStyle() void ScraperSearchComponent::search(const ScraperSearchParams& params) { + mBlockAccept = true; + mResultList->clear(); mScraperResults.clear(); mThumbnailReq.reset(); diff --git a/es-app/src/scrapers/Scraper.cpp b/es-app/src/scrapers/Scraper.cpp index ff4ba88db..5bc9b0ef6 100644 --- a/es-app/src/scrapers/Scraper.cpp +++ b/es-app/src/scrapers/Scraper.cpp @@ -41,7 +41,7 @@ void ScraperSearchHandle::update() if(mStatus == ASYNC_DONE) return; - while(!mRequestQueue.empty()) + if(!mRequestQueue.empty()) { auto& req = mRequestQueue.front(); AsyncHandleStatus status = req->status(); @@ -62,7 +62,6 @@ void ScraperSearchHandle::update() if(status == ASYNC_DONE) { mRequestQueue.pop(); - continue; } // status == ASYNC_IN_PROGRESS