过滤autostart目录应用desktop文件

This commit is contained in:
hewenfei 2023-05-23 16:58:30 +08:00
parent 1506d60e5c
commit f37cf0ece0
1 changed files with 13 additions and 6 deletions

View File

@ -109,6 +109,7 @@ void AppDataWorker::initAppData()
<< UkuiSearch::ApplicationProperty::Property::Category
<< UkuiSearch::ApplicationProperty::Property::FirstLetterAll
<< UkuiSearch::ApplicationProperty::Property::DontDisplay
<< UkuiSearch::ApplicationProperty::Property::AutoStart
<< UkuiSearch::ApplicationProperty::Property::InsertTime
<< UkuiSearch::ApplicationProperty::Property::Launched;
m_appPropertyMap.insert(UkuiSearch::ApplicationProperty::Property::DontDisplay, 0);
@ -172,13 +173,19 @@ void AppDataWorker::appendApps(const QStringList &infos, QList<DataEntity> &apps
{
QMutexLocker locker(&m_appManager->m_mutex);
for (const QString &info : infos) {
UkuiSearch::ApplicationPropertyMap appinfo = m_applicationInfo->getInfo(info, m_appProperties);
if (appinfo.value(UkuiSearch::ApplicationProperty::Property::DontDisplay).toInt() == 0) {
DataEntity app;
addInfoToApp(appinfo, app);
m_appManager->m_normalApps.insert(app.id(), app);
apps.append(app);
const UkuiSearch::ApplicationPropertyMap appInfo = m_applicationInfo->getInfo(info, m_appProperties);
if (appInfo.value(UkuiSearch::ApplicationProperty::Property::DontDisplay).toInt() != 0) {
continue;
}
if (appInfo.value(UkuiSearch::ApplicationProperty::Property::AutoStart).toInt() != 0) {
continue;
}
DataEntity app;
addInfoToApp(appInfo, app);
m_appManager->m_normalApps.insert(app.id(), app);
apps.append(app);
}
}