diff --git a/src/plugins/coreplugin/welcomepagehelper.cpp b/src/plugins/coreplugin/welcomepagehelper.cpp index d80942f13d4..d12e427b2fc 100644 --- a/src/plugins/coreplugin/welcomepagehelper.cpp +++ b/src/plugins/coreplugin/welcomepagehelper.cpp @@ -811,10 +811,24 @@ ListModel *SectionedGridView::addSection(const Section §ion, const QListinsertWidget(position, sectionLabel); vbox->insertWidget(position + 1, gridView); + struct ItemHash + { + std::size_t operator()(ListItem *item) const { return std::hash{}(item->name); } + }; + struct ItemEqual + { + bool operator()(ListItem *lhs, ListItem *rhs) const + { + return lhs->name == rhs->name && lhs->description == rhs->description; + } + }; + // add the items also to the all products model to be able to search correctly - const QSet allItems = toSet(m_allItemsModel->items()); - const QList newItems = filtered(items, [&allItems](ListItem *item) { - return !allItems.contains(item); + const QList allItems = m_allItemsModel->items(); + const std::unordered_set uniqueItems{allItems.constBegin(), + allItems.constEnd()}; + const QList newItems = filtered(items, [&uniqueItems](ListItem *item) { + return uniqueItems.find(item) == uniqueItems.end(); }); m_allItemsModel->appendItems(newItems);