summaryrefslogtreecommitdiffstats
path: root/framework/src/domain/folderlistmodel.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-20 13:55:56 -0600
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-20 13:55:56 -0600
commitf6e6cd8a5c8ef2d8d7e331834dff026646be543e (patch)
tree68fda89590301378d1e2658498451a1c43f55aea /framework/src/domain/folderlistmodel.h
parentc6d028cebbfce9e4d9437ace37a5ac327eaee25d (diff)
downloadkube-f6e6cd8a5c8ef2d8d7e331834dff026646be543e.tar.gz
kube-f6e6cd8a5c8ef2d8d7e331834dff026646be543e.zip
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.
Diffstat (limited to 'framework/src/domain/folderlistmodel.h')
-rw-r--r--framework/src/domain/folderlistmodel.h7
1 files changed, 3 insertions, 4 deletions
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 @@
20 20
21#pragma once 21#pragma once
22 22
23#include <QObject> 23#include <krecursivefilterproxymodel.h>
24#include <QSortFilterProxyModel>
25#include <QSharedPointer> 24#include <QSharedPointer>
26#include <QStringList>
27 25
28namespace Sink { 26namespace Sink {
29 class Query; 27 class Query;
30} 28}
31 29
32class FolderListModel : public QSortFilterProxyModel 30class FolderListModel : public KRecursiveFilterProxyModel
33{ 31{
34 Q_OBJECT 32 Q_OBJECT
35 33
@@ -69,6 +67,7 @@ public:
69 QVariant folderId() const; 67 QVariant folderId() const;
70protected: 68protected:
71 bool lessThan(const QModelIndex &left, const QModelIndex &right) const Q_DECL_OVERRIDE; 69 bool lessThan(const QModelIndex &left, const QModelIndex &right) const Q_DECL_OVERRIDE;
70 bool acceptRow(int sourceRow, const QModelIndex &sourceParent) const Q_DECL_OVERRIDE;
72 71
73private: 72private:
74 void runQuery(const Sink::Query &query); 73 void runQuery(const Sink::Query &query);