diff --git a/src/libappdata/app-search-plugin.cpp b/src/libappdata/app-search-plugin.cpp index 5df6f84..bd05991 100644 --- a/src/libappdata/app-search-plugin.cpp +++ b/src/libappdata/app-search-plugin.cpp @@ -19,6 +19,7 @@ */ #include "app-search-plugin.h" #include "data-entity.h" +#include "basic-app-model.h" #include #include @@ -60,9 +61,7 @@ AppSearchPluginPrivate::AppSearchPluginPrivate(QObject *parent) : QThread(parent m_appSearchTask->setSearchOnlineApps(false); UkuiSearch::SearchResultProperties searchResultProperties; - searchResultProperties << UkuiSearch::SearchProperty::SearchResultProperty::ApplicationDesktopPath - << UkuiSearch::SearchProperty::SearchResultProperty::ApplicationLocalName - << UkuiSearch::SearchProperty::SearchResultProperty::ApplicationIconName; + searchResultProperties << UkuiSearch::SearchProperty::SearchResultProperty::ApplicationDesktopPath; m_appSearchTask->setResultProperties(UkuiSearch::SearchProperty::SearchType::Application, searchResultProperties); m_timer = new QTimer; @@ -101,11 +100,10 @@ void AppSearchPluginPrivate::run() m_timer->stop(); if (result.getSearchId() == m_searchId) { DataEntity app; - app.setType(DataType::Normal); - app.setId(result.getValue(UkuiSearch::SearchProperty::ApplicationDesktopPath).toString()); - app.setName(result.getValue(UkuiSearch::SearchProperty::ApplicationLocalName).toString()); - app.setIcon(result.getValue(UkuiSearch::SearchProperty::ApplicationIconName).toString()); - + QString id = result.getValue(UkuiSearch::SearchProperty::ApplicationDesktopPath).toString(); + if (!BasicAppModel::instance()->getAppById(id, app)) { + BasicAppModel::instance()->databaseInterface()->getApp(id, app); + }; Q_EMIT this->searchedOne(app); } }