+void PlacesItemModel::onSourceModelGroupHiddenChanged(KFilePlacesModel::GroupType group, bool hidden)
+{
+ for(const QModelIndex &sourceIndex : m_sourceModel->groupIndexes(group)) {
+ PlacesItem *item = placesItem(mapFromSource(sourceIndex));
+ if (item) {
+ item->setGroupHidden(hidden);
+ }
+ }
+}
+
+void PlacesItemModel::cleanupBookmarks()
+{
+ // KIO model now provides support for baloo urls, and because of that we
+ // need to remove old URLs that were visible only in Dolphin to avoid duplication
+ int row = 0;
+ do {
+ const QModelIndex sourceIndex = m_sourceModel->index(row, 0);
+ const KBookmark bookmark = m_sourceModel->bookmarkForIndex(sourceIndex);
+ const QUrl url = bookmark.url();
+ const QString appName = bookmark.metaDataItem(QStringLiteral("OnlyInApp"));
+
+ if ((appName == KAboutData::applicationData().componentName() ||
+ appName == KAboutData::applicationData().componentName() + AppNameSuffix) && balooURLs.contains(url)) {
+ qCDebug(DolphinDebug) << "Removing old baloo url:" << url;
+ m_sourceModel->removePlace(sourceIndex);
+ } else {
+ row++;
+ }
+ } while (row < m_sourceModel->rowCount());
+}
+