From c0c634f98060422e776cb2f700839cc2fb4693dc Mon Sep 17 00:00:00 2001 From: JunjieBai Date: Thu, 20 Jul 2023 16:42:29 +0800 Subject: [PATCH] Fix the problem that the online app will not be shown because of timeout. --- frontend/model/search-result-manager.cpp | 4 ++-- libsearch/appsearch/app-search-plugin.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/model/search-result-manager.cpp b/frontend/model/search-result-manager.cpp index 9358f37..004b02d 100644 --- a/frontend/model/search-result-manager.cpp +++ b/frontend/model/search-result-manager.cpp @@ -72,7 +72,7 @@ void ReceiveResultThread::stop() void ReceiveResultThread::run() { - QDeadlineTimer deadline(3000); + QDeadlineTimer deadline(25000); while(!isInterruptionRequested()) { SearchPluginIface::ResultInfo oneResult = m_resultQueue->tryDequeue(); if(oneResult.name.isEmpty()) { @@ -82,7 +82,7 @@ void ReceiveResultThread::run() this->requestInterruption(); } } else { - deadline.setRemainingTime(3000); + deadline.setRemainingTime(25000); Q_EMIT gotResultInfo(oneResult); } } diff --git a/libsearch/appsearch/app-search-plugin.cpp b/libsearch/appsearch/app-search-plugin.cpp index 8693926..9328457 100644 --- a/libsearch/appsearch/app-search-plugin.cpp +++ b/libsearch/appsearch/app-search-plugin.cpp @@ -86,6 +86,8 @@ void AppSearchPlugin::KeywordSearch(QString keyword, DataQueuestop(); + this->requestInterruption(); + this->wait(); } QList AppSearchPlugin::getActioninfo(int type) @@ -173,7 +175,7 @@ QWidget *AppSearchPlugin::detailPage(const ResultInfo &ri) void AppSearchPlugin::run() { - QDeadlineTimer deadline(3000); + QDeadlineTimer deadline(25000); while(!isInterruptionRequested()) { ResultItem oneResult = m_appSearchResults->tryDequeue(); SearchResultPropertyMap data = oneResult.getAllValue(); @@ -185,7 +187,7 @@ void AppSearchPlugin::run() } } else { - deadline.setRemainingTime(3000); + deadline.setRemainingTime(25000); SearchPluginIface::ResultInfo ri; ri.name = data.value(SearchProperty::SearchResultProperty::ApplicationLocalName).toString();