Changeset View
Changeset View
Standalone View
Standalone View
src/core/models/entityrightsfiltermodel.h
Show All 14 Lines | 1 | /* | |||
---|---|---|---|---|---|
15 | along with this library; see the file COPYING.LIB. If not, write to the | 15 | along with this library; see the file COPYING.LIB. If not, write to the | ||
16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
17 | 02110-1301, USA. | 17 | 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #ifndef AKONADI_ENTITYRIGHTSFILTERMODEL_H | 20 | #ifndef AKONADI_ENTITYRIGHTSFILTERMODEL_H | ||
21 | #define AKONADI_ENTITYRIGHTSFILTERMODEL_H | 21 | #define AKONADI_ENTITYRIGHTSFILTERMODEL_H | ||
22 | 22 | | |||
23 | #include "akonadicore_export.h" | ||||
23 | #include "entitytreemodel.h" | 24 | #include "entitytreemodel.h" | ||
24 | 25 | | |||
25 | #include <krecursivefilterproxymodel.h> | 26 | #include <QSortFilterProxyModel> | ||
26 | | ||||
27 | #include "akonadicore_export.h" | | |||
28 | 27 | | |||
29 | namespace Akonadi | 28 | namespace Akonadi | ||
30 | { | 29 | { | ||
31 | 30 | | |||
32 | class EntityRightsFilterModelPrivate; | 31 | class EntityRightsFilterModelPrivate; | ||
33 | 32 | | |||
34 | /** | 33 | /** | ||
35 | * @short A proxy model that filters entities by access rights. | 34 | * @short A proxy model that filters entities by access rights. | ||
Show All 17 Lines | |||||
53 | * @endcode | 52 | * @endcode | ||
54 | * | 53 | * | ||
55 | * @li For collections the access rights are checked against the collections own rights. | 54 | * @li For collections the access rights are checked against the collections own rights. | ||
56 | * @li For items the access rights are checked against the item's parent collection rights. | 55 | * @li For items the access rights are checked against the item's parent collection rights. | ||
57 | * | 56 | * | ||
58 | * @author Tobias Koenig <tokoe@kde.org> | 57 | * @author Tobias Koenig <tokoe@kde.org> | ||
59 | * @since 4.6 | 58 | * @since 4.6 | ||
60 | */ | 59 | */ | ||
61 | class AKONADICORE_EXPORT EntityRightsFilterModel : public KRecursiveFilterProxyModel | 60 | class AKONADICORE_EXPORT EntityRightsFilterModel : public QSortFilterProxyModel | ||
62 | { | 61 | { | ||
63 | Q_OBJECT | 62 | Q_OBJECT | ||
64 | 63 | | |||
65 | public: | 64 | public: | ||
66 | /** | 65 | /** | ||
67 | * Creates a new entity rights filter model. | 66 | * Creates a new entity rights filter model. | ||
68 | * | 67 | * | ||
69 | * @param parent The parent object. | 68 | * @param parent The parent object. | ||
Show All 24 Lines | |||||
94 | Q_REQUIRED_RESULT Qt::ItemFlags flags(const QModelIndex &index) const override; | 93 | Q_REQUIRED_RESULT Qt::ItemFlags flags(const QModelIndex &index) const override; | ||
95 | 94 | | |||
96 | /** | 95 | /** | ||
97 | * @reimp | 96 | * @reimp | ||
98 | */ | 97 | */ | ||
99 | Q_REQUIRED_RESULT QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits = 1, | 98 | Q_REQUIRED_RESULT QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits = 1, | ||
100 | Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith | Qt::MatchWrap)) const override; | 99 | Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith | Qt::MatchWrap)) const override; | ||
101 | 100 | | |||
102 | protected: | | |||
103 | bool acceptRow(int sourceRow, const QModelIndex &sourceParent) const override; | | |||
104 | | ||||
105 | private: | 101 | private: | ||
106 | //@cond PRIVATE | 102 | //@cond PRIVATE | ||
107 | Q_DECLARE_PRIVATE(EntityRightsFilterModel) | 103 | Q_DECLARE_PRIVATE(EntityRightsFilterModel) | ||
108 | EntityRightsFilterModelPrivate *const d_ptr; | 104 | EntityRightsFilterModelPrivate *const d_ptr; | ||
109 | //@endcond | 105 | //@endcond | ||
110 | }; | 106 | }; | ||
111 | 107 | | |||
112 | } | 108 | } | ||
113 | 109 | | |||
114 | #endif | 110 | #endif |