[Kde-pim] KDE/kdepimlibs/akonadi

Stephen Kelly steveire at gmail.com
Mon Nov 30 15:23:19 GMT 2009


SVN commit 1056677 by skelly:

Make the EntityRightsFilterModel private.

The proxy attempts to to recursive filtering, but does not keep
up-to-date with the source model. Rebase it on KRecursiveFilterProxyModel
which does, but which will not be public API until 4.5.

CCMAIL: kde-pim at kde.org

 M  +3 -1      CMakeLists.txt  
 M  +3 -9      entityrightsfiltermodel.cpp  
 M  +2 -2      entityrightsfiltermodel.h  
 A             krecursivefilterproxymodel.cpp   [License: LGPL (v2+)]
 A             krecursivefilterproxymodel.h   [License: LGPL (v2+)]


--- trunk/KDE/kdepimlibs/akonadi/CMakeLists.txt #1056676:1056677
@@ -112,6 +112,7 @@
   itemview.cpp
   job.cpp
   kdescendantsproxymodel.cpp
+  krecursivefilterproxymodel.cpp
   linkjob.cpp
   mimetypechecker.cpp
   monitor.cpp
@@ -232,7 +233,8 @@
   entityhiddenattribute.h
   entitylistview.h
   entitymimetypefiltermodel.h
-  entityrightsfiltermodel.h
+# Made private in 4.4 -- Stephen Kelly.
+#  entityrightsfiltermodel.h
   entitytreemodel.h
   entitytreeview.h
   entitytreeviewstatesaver.h
--- trunk/KDE/kdepimlibs/akonadi/entityrightsfiltermodel.cpp #1056676:1056677
@@ -68,7 +68,7 @@
 }
 
 EntityRightsFilterModel::EntityRightsFilterModel( QObject *parent )
-  : QSortFilterProxyModel( parent ),
+  : KRecursiveFilterProxyModel( parent ),
     d_ptr( new EntityRightsFilterModelPrivate( this ) )
 {
 }
@@ -97,12 +97,6 @@
 
   const QModelIndex modelIndex = sourceModel()->index( sourceRow, 0, sourceParent );
 
-  // one of our children might be accepted, so accept this row if one of our children are accepted.
-  for ( int row = 0 ; row < sourceModel()->rowCount( modelIndex ); row++ ) {
-    if ( filterAcceptsRow( row, modelIndex ) )
-      return true;
-  }
-
   return d->rightsMatches( modelIndex );
 }
 
@@ -111,9 +105,9 @@
   Q_D(const EntityRightsFilterModel);
 
   if ( d->rightsMatches( index ) )
-    return QSortFilterProxyModel::flags( index );
+    return KRecursiveFilterProxyModel::flags( index );
   else
-    return QSortFilterProxyModel::flags( index ) & ~(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
+    return KRecursiveFilterProxyModel::flags( index ) & ~(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
 }
 
 #include "entityrightsfiltermodel.moc"
--- trunk/KDE/kdepimlibs/akonadi/entityrightsfiltermodel.h #1056676:1056677
@@ -23,7 +23,7 @@
 #include "akonadi_export.h"
 #include "entitytreemodel.h"
 
-#include <QtGui/QSortFilterProxyModel>
+#include "krecursivefilterproxymodel.h"
 
 namespace Akonadi {
 
@@ -56,7 +56,7 @@
  * @author Tobias Koenig <tokoe at kde.org>
  * @since 4.4
  */
-class AKONADI_EXPORT EntityRightsFilterModel : public QSortFilterProxyModel
+class EntityRightsFilterModel : public KRecursiveFilterProxyModel
 {
   Q_OBJECT
 
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list