Fix the problem that the online app will not be shown because of timeout.

This commit is contained in:
JunjieBai 2023-07-20 16:42:29 +08:00
parent 1134ffc8be
commit c0c634f980
2 changed files with 6 additions and 4 deletions

View File

@ -72,7 +72,7 @@ void ReceiveResultThread::stop()
void ReceiveResultThread::run() void ReceiveResultThread::run()
{ {
QDeadlineTimer deadline(3000); QDeadlineTimer deadline(25000);
while(!isInterruptionRequested()) { while(!isInterruptionRequested()) {
SearchPluginIface::ResultInfo oneResult = m_resultQueue->tryDequeue(); SearchPluginIface::ResultInfo oneResult = m_resultQueue->tryDequeue();
if(oneResult.name.isEmpty()) { if(oneResult.name.isEmpty()) {
@ -82,7 +82,7 @@ void ReceiveResultThread::run()
this->requestInterruption(); this->requestInterruption();
} }
} else { } else {
deadline.setRemainingTime(3000); deadline.setRemainingTime(25000);
Q_EMIT gotResultInfo(oneResult); Q_EMIT gotResultInfo(oneResult);
} }
} }

View File

@ -86,6 +86,8 @@ void AppSearchPlugin::KeywordSearch(QString keyword, DataQueue<SearchPluginIface
void AppSearchPlugin::stopSearch() void AppSearchPlugin::stopSearch()
{ {
m_appSearchTask->stop(); m_appSearchTask->stop();
this->requestInterruption();
this->wait();
} }
QList<SearchPluginIface::Actioninfo> AppSearchPlugin::getActioninfo(int type) QList<SearchPluginIface::Actioninfo> AppSearchPlugin::getActioninfo(int type)
@ -173,7 +175,7 @@ QWidget *AppSearchPlugin::detailPage(const ResultInfo &ri)
void AppSearchPlugin::run() void AppSearchPlugin::run()
{ {
QDeadlineTimer deadline(3000); QDeadlineTimer deadline(25000);
while(!isInterruptionRequested()) { while(!isInterruptionRequested()) {
ResultItem oneResult = m_appSearchResults->tryDequeue(); ResultItem oneResult = m_appSearchResults->tryDequeue();
SearchResultPropertyMap data = oneResult.getAllValue(); SearchResultPropertyMap data = oneResult.getAllValue();
@ -185,7 +187,7 @@ void AppSearchPlugin::run()
} }
} else { } else {
deadline.setRemainingTime(3000); deadline.setRemainingTime(25000);
SearchPluginIface::ResultInfo ri; SearchPluginIface::ResultInfo ri;
ri.name = data.value(SearchProperty::SearchResultProperty::ApplicationLocalName).toString(); ri.name = data.value(SearchProperty::SearchResultProperty::ApplicationLocalName).toString();