]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Take also in count if the rowcount was changed. Then everything needs to be recached...
authorRafael Fernández López <ereslibre@kde.org>
Sun, 14 Oct 2007 23:45:28 +0000 (23:45 +0000)
committerRafael Fernández López <ereslibre@kde.org>
Sun, 14 Oct 2007 23:45:28 +0000 (23:45 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=725218

src/kcategorizedview.cpp
src/kcategorizedview_p.h

index 24603b98bd6bd56d5368118b6b9205aff61ae6ef..7d717abd1f4388319486c27e71cb8a698bac820c 100644 (file)
@@ -422,6 +422,7 @@ void KCategorizedView::Private::layoutChanged(bool forceItemReload)
           (modelSortRole != proxyModel->sortRole()) ||
           (modelSortColumn != proxyModel->sortColumn()) ||
           (modelSortOrder != proxyModel->sortOrder()) ||
+          (modelLastRowCount != proxyModel->rowCount()) ||
           (modelCategorized != proxyModel->isCategorizedModel()))))
     {
         // Force the view to update all elements
@@ -432,6 +433,7 @@ void KCategorizedView::Private::layoutChanged(bool forceItemReload)
             modelSortRole = proxyModel->sortRole();
             modelSortColumn = proxyModel->sortColumn();
             modelSortOrder = proxyModel->sortOrder();
+            modelLastRowCount = proxyModel->rowCount();
             modelCategorized = proxyModel->isCategorizedModel();
         }
     }
@@ -526,6 +528,7 @@ void KCategorizedView::setModel(QAbstractItemModel *model)
         d->modelSortRole = d->proxyModel->sortRole();
         d->modelSortColumn = d->proxyModel->sortColumn();
         d->modelSortOrder = d->proxyModel->sortOrder();
+        d->modelLastRowCount = d->proxyModel->rowCount();
         d->modelCategorized = d->proxyModel->isCategorizedModel();
 
         QObject::connect(d->proxyModel,
index 3b1e2cef621d459f97dec6bb56b5418af20a0a78..aa55cda75c71d47d6cf6bca4a940f15aa01683eb 100644 (file)
@@ -153,6 +153,7 @@ public:
     QRect lastSelectionRect;
     int modelSortRole;
     int modelSortColumn;
+    int modelLastRowCount;
     bool modelCategorized;
     Qt::SortOrder modelSortOrder;