fix(search):修复搜索状态下,应用右键菜单始终为添加到收藏的问题
This commit is contained in:
parent
31050086de
commit
e96eee26fc
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
#include "app-search-plugin.h"
|
||||
#include "data-entity.h"
|
||||
#include "basic-app-model.h"
|
||||
|
||||
#include <UkuiSearchTask>
|
||||
#include <QThread>
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue