]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/places/placesitemmodel.cpp
Merge branch 'Applications/18.04'
[dolphin.git] / src / panels / places / placesitemmodel.cpp
index 444ad29eaba6ad51290c8e03e3aba1ab03fa3494..7e313482da21455c327ddcf95f171a837be98088 100644 (file)
@@ -397,10 +397,7 @@ void PlacesItemModel::addItemFromSourceModel(const QModelIndex &index)
 
     const KBookmark bookmark = m_sourceModel->bookmarkForIndex(index);
     Q_ASSERT(!bookmark.isNull());
-    PlacesItem *item = itemFromBookmark(bookmark);
-    if (!item) {
-        item = new PlacesItem(bookmark);
-    }
+    PlacesItem *item = new PlacesItem(bookmark);
     updateItem(item, index);
     insertSortedItem(item);
 
@@ -456,7 +453,7 @@ void PlacesItemModel::initializeDefaultViewProperties() const
                 } else if (path == QLatin1String("/images")) {
                     props.setViewMode(DolphinView::IconsView);
                     props.setPreviewsShown(true);
-                    props.setVisibleRoles({"text", "imageSize"});
+                    props.setVisibleRoles({"text", "height", "width"});
                 } else if (path == QLatin1String("/audio")) {
                     props.setViewMode(DolphinView::DetailsView);
                     props.setPreviewsShown(false);
@@ -600,7 +597,8 @@ void PlacesItemModel::onSourceModelDataChanged(const QModelIndex &topLeft, const
 
 void PlacesItemModel::onSourceModelGroupHiddenChanged(KFilePlacesModel::GroupType group, bool hidden)
 {
-    for(const QModelIndex &sourceIndex : m_sourceModel->groupIndexes(group)) {
+    const auto groupIndexes = m_sourceModel->groupIndexes(group);
+    for (const QModelIndex &sourceIndex : groupIndexes) {
         PlacesItem *item = placesItem(mapFromSource(sourceIndex));
         if (item) {
             item->setGroupHidden(hidden);