From f6e6cd8a5c8ef2d8d7e331834dff026646be543e Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 20 Aug 2017 13:55:56 -0600 Subject: Filter enabled folders using a krecursivefilterproxymodel The KRecursiveFilterProxyModel is necessary until Qt 5.10 when QSortFilterProxyModel will support recursive filtering. For the recursive filtering to work we need to make all data available, so we trigger fetchMore on all added indexes. --- framework/src/domain/folderlistmodel.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'framework/src/domain/folderlistmodel.h') diff --git a/framework/src/domain/folderlistmodel.h b/framework/src/domain/folderlistmodel.h index 0e412202..738cf4a0 100644 --- a/framework/src/domain/folderlistmodel.h +++ b/framework/src/domain/folderlistmodel.h @@ -20,16 +20,14 @@ #pragma once -#include -#include +#include #include -#include namespace Sink { class Query; } -class FolderListModel : public QSortFilterProxyModel +class FolderListModel : public KRecursiveFilterProxyModel { Q_OBJECT @@ -69,6 +67,7 @@ public: QVariant folderId() const; protected: bool lessThan(const QModelIndex &left, const QModelIndex &right) const Q_DECL_OVERRIDE; + bool acceptRow(int sourceRow, const QModelIndex &sourceParent) const Q_DECL_OVERRIDE; private: void runQuery(const Sink::Query &query); -- cgit v1.2.3