完善应用搜索中断返回逻辑;

This commit is contained in:
jixiaoxu 2023-01-16 15:56:58 +08:00 committed by iaom
parent 5ae3c47ec4
commit d42f29f88a
1 changed files with 4 additions and 2 deletions

View File

@ -65,7 +65,6 @@ AppSearchWorker::AppSearchWorker(AppSearchTask *AppSarchTask, std::shared_ptr<Se
void AppSearchWorker::run() void AppSearchWorker::run()
{ {
m_currentSearchId = m_searchController->getCurrentSearchId(); m_currentSearchId = m_searchController->getCurrentSearchId();
bool finished = true;
QStringList results; QStringList results;
QStringList keyWords = m_searchController->getKeyword(); QStringList keyWords = m_searchController->getKeyword();
ResultDataTypes dataType = m_searchController->getResultDataType(SearchType::Application); ResultDataTypes dataType = m_searchController->getResultDataType(SearchType::Application);
@ -94,6 +93,7 @@ void AppSearchWorker::run()
} else { } else {
qDebug() << "Search id changed!"; qDebug() << "Search id changed!";
m_searchController->finishSearchIdCheck(); m_searchController->finishSearchIdCheck();
return;
} }
} }
if (m_searchController->isSearchOnlineApps()) { if (m_searchController->isSearchOnlineApps()) {
@ -130,15 +130,17 @@ void AppSearchWorker::run()
} else { } else {
qDebug() << "Search id changed!"; qDebug() << "Search id changed!";
m_searchController->finishSearchIdCheck(); m_searchController->finishSearchIdCheck();
return;
} }
} }
} else { } else {
qWarning() << "SoftWareCenter dbus called failed!" << reply.error(); qWarning() << "SoftWareCenter dbus called failed!" << reply.error();
sendErrorMsg(QString("SoftWareCenter dbus called failed!") + reply.error().message());
} }
} }
} }
if (finished) QMetaObject::invokeMethod(m_AppSearchTask, "searchFinished", Q_ARG(size_t, m_currentSearchId)); QMetaObject::invokeMethod(m_AppSearchTask, "searchFinished", Q_ARG(size_t, m_currentSearchId));
} }
AppSearchWorker::~AppSearchWorker() AppSearchWorker::~AppSearchWorker()