diff --git a/libsearch/searchinterface/searchtasks/app-search-task.cpp b/libsearch/searchinterface/searchtasks/app-search-task.cpp index b615988..b674831 100644 --- a/libsearch/searchinterface/searchtasks/app-search-task.cpp +++ b/libsearch/searchinterface/searchtasks/app-search-task.cpp @@ -65,7 +65,6 @@ AppSearchWorker::AppSearchWorker(AppSearchTask *AppSarchTask, std::shared_ptrgetCurrentSearchId(); - bool finished = true; QStringList results; QStringList keyWords = m_searchController->getKeyword(); ResultDataTypes dataType = m_searchController->getResultDataType(SearchType::Application); @@ -94,6 +93,7 @@ void AppSearchWorker::run() } else { qDebug() << "Search id changed!"; m_searchController->finishSearchIdCheck(); + return; } } if (m_searchController->isSearchOnlineApps()) { @@ -130,15 +130,17 @@ void AppSearchWorker::run() } else { qDebug() << "Search id changed!"; m_searchController->finishSearchIdCheck(); + return; } } } else { 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()