Skip to content

Commit

Permalink
fix: There are empty application groups.
Browse files Browse the repository at this point in the history
 When uninstalling an application, the check for empty application groups is not handled.

log: as title
issue: linuxdeepin/developer-center#8367
  • Loading branch information
robertkill committed May 6, 2024
1 parent f9b084b commit 9c9c1e8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/models/itemarrangementproxymodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,12 @@ void ItemArrangementProxyModel::onSourceModelChanged()
}

m_topLevel->removeItemsNotIn(appDesktopIdSet);
for (int i = 0; i < m_folderModel.rowCount(); i++) {
for (int i = m_folderModel.rowCount() - 1; i >= 0 ; i--) {
const QString & folderId = m_folderModel.index(i, 0).data(AppItem::DesktopIdRole).toString();
m_folders.value(folderId)->removeItemsNotIn(appDesktopIdSet);
if (m_folders.value(folderId)->pageCount() == 0) {
removeFolder(QString(folderId).remove("internal/folders/"));
}
}

emit dataChanged(index(0, 0), index(rowCount() - 1, 0), {
Expand Down

0 comments on commit 9c9c1e8

Please sign in to comment.