From f37cf0ece03274f47b1cb92c077c9df23ba7fd6d Mon Sep 17 00:00:00 2001 From: hewenfei Date: Tue, 23 May 2023 16:58:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E6=BB=A4autostart=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E5=BA=94=E7=94=A8desktop=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/appdata/app-data-manager.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/appdata/app-data-manager.cpp b/src/appdata/app-data-manager.cpp index 2a6a554..5822e5d 100644 --- a/src/appdata/app-data-manager.cpp +++ b/src/appdata/app-data-manager.cpp @@ -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 &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); } }