]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemlistview.cpp
Fix wrong text eliding in some corner cases.
[dolphin.git] / src / kitemviews / kfileitemlistview.cpp
index 1ffd5019b48dd9ac4719d3bbc12a2460279164bb..fd01f2c4c23565827f7ed6b1e4aaf0e3b99f141e 100644 (file)
@@ -119,7 +119,7 @@ QStringList KFileItemListView::enabledPlugins() const
     return m_modelRolesUpdater ? m_modelRolesUpdater->enabledPlugins() : QStringList();
 }
 
-QPixmap KFileItemListView::createDragPixmap(const QSet<int>& indexes) const
+QPixmap KFileItemListView::createDragPixmap(const KItemSet& indexes) const
 {
     if (!model()) {
         return QPixmap();
@@ -165,10 +165,8 @@ QPixmap KFileItemListView::createDragPixmap(const QSet<int>& indexes) const
     QPainter painter(&dragPixmap);
     int x = 0;
     int y = 0;
-    QSetIterator<int> it(indexes);
-    while (it.hasNext()) {
-        const int index = it.next();
 
+    foreach (int index, indexes) {
         QPixmap pixmap = model()->data(index).value("iconPixmap").value<QPixmap>();
         if (pixmap.isNull()) {
             KIcon icon(model()->data(index).value("iconName").toString());
@@ -221,12 +219,6 @@ void KFileItemListView::onPreviewsShownChanged(bool shown)
 
 void KFileItemListView::onItemLayoutChanged(ItemLayout current, ItemLayout previous)
 {
-    if (previous == DetailsLayout || current == DetailsLayout) {
-        // The details-layout requires some invisible roles that
-        // must be added to the model if the new layout is "details".
-        // If the old layout was "details" the roles will get removed.
-        applyRolesToModel();
-    }
     KStandardItemListView::onItemLayoutChanged(current, previous);
     triggerVisibleIndexRangeUpdate();
 }