]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kcategorizedview.cpp
fixed memory leaks (thanks to David for fixing this in KDirOperator)
[dolphin.git] / src / kcategorizedview.cpp
index 894da2caeeea2328163782cb9ee50938b5288b50..c062b12b3212cd3e78de39c7d134f2209304ba2e 100644 (file)
@@ -24,7 +24,6 @@
 #include <math.h> // trunc on C99 compliant systems
 #include <kdefakes.h> // trunc for not C99 compliant systems
 
-#include <QApplication>
 #include <QPainter>
 #include <QScrollBar>
 #include <QPaintEvent>
@@ -361,7 +360,7 @@ void KCategorizedView::Private::drawNewCategory(const QModelIndex &index,
     }
 
     QStyleOption optionCopy = option;
-    const QString category = proxyModel->data(index, KCategorizedSortFilterProxyModel::CategoryRole).toString();
+    const QString category = proxyModel->data(index, KCategorizedSortFilterProxyModel::CategoryDisplayRole).toString();
 
     optionCopy.state &= ~QStyle::State_Selected;
 
@@ -1329,7 +1328,7 @@ void KCategorizedView::rowsInsertedArtifficial(const QModelIndex &parent,
     }
 
     // Add all elements mapped to the source model and explore categories
-    QString prevCategory = d->proxyModel->data(d->proxyModel->index(0, d->proxyModel->sortColumn()), KCategorizedSortFilterProxyModel::CategoryRole).toString();
+    QString prevCategory = d->proxyModel->data(d->proxyModel->index(0, d->proxyModel->sortColumn()), KCategorizedSortFilterProxyModel::CategoryDisplayRole).toString();
     QString lastCategory = prevCategory;
     QModelIndexList modelIndexList;
     struct Private::ElementInfo elementInfo;
@@ -1346,7 +1345,7 @@ void KCategorizedView::rowsInsertedArtifficial(const QModelIndex &parent,
 
         d->modelIndexList << index;
 
-        lastCategory = d->proxyModel->data(index, KCategorizedSortFilterProxyModel::CategoryRole).toString();
+        lastCategory = d->proxyModel->data(index, KCategorizedSortFilterProxyModel::CategoryDisplayRole).toString();
 
         elementInfo.category = lastCategory;