过滤应用数据刷新信号

This commit is contained in:
hewenfei 2023-05-06 11:24:14 +08:00
parent b6da65c021
commit da6611ca65
1 changed files with 12 additions and 0 deletions

View File

@ -146,6 +146,9 @@ void AppDataWorker::onAppAdded(const QStringList &infos)
QList<DataEntity> apps; QList<DataEntity> apps;
appendApps(infos, apps); appendApps(infos, apps);
if (apps.isEmpty()) {
return;
}
Q_EMIT appAdded(apps); Q_EMIT appAdded(apps);
updateFavoriteApps(); updateFavoriteApps();
@ -188,6 +191,9 @@ void AppDataWorker::onAppUpdated(const UkuiSearch::ApplicationInfoMap &infos)
QList<DataEntity> apps; QList<DataEntity> apps;
updateApps(infos, apps); updateApps(infos, apps);
if (apps.isEmpty()) {
return;
}
Q_EMIT appUpdated(apps); Q_EMIT appUpdated(apps);
updateFavoriteApps(); updateFavoriteApps();
@ -201,6 +207,9 @@ void AppDataWorker::onAppUpdatedAll(const QStringList &infos)
QList<DataEntity> apps; QList<DataEntity> apps;
updateAppsAll(infos, apps); updateAppsAll(infos, apps);
if (apps.isEmpty()) {
return;
}
Q_EMIT appUpdated(apps); Q_EMIT appUpdated(apps);
updateFavoriteApps(); updateFavoriteApps();
@ -281,6 +290,9 @@ void AppDataWorker::onAppDeleted(QStringList infos)
} }
QStringList removedIdList; QStringList removedIdList;
removeApps(infos, removedIdList); removeApps(infos, removedIdList);
if (removedIdList.isEmpty()) {
return;
}
Q_EMIT appDeleted(removedIdList); Q_EMIT appDeleted(removedIdList);
updateFavoriteApps(); updateFavoriteApps();