Akonadi
collectionfilterproxymodel.cpp
37bool CollectionFilterProxyModelPrivate::collectionAccepted(const QModelIndex &index, bool checkResourceVisibility)
40 const auto collection = mParent->sourceModel()->data(index, EntityTreeModel::CollectionRole).value<Collection>();
62 qCDebug(AKONADICORE_LOG) << "We got a new collection:" << mParent->sourceModel()->data(index).toString()
82 if (collectionAccepted(childIndex, false /* don't check visibility of the parent, as we are checking the child now */)) {
118bool CollectionFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
154 const auto collection = sourceModel()->data(mapToSource(index), EntityTreeModel::CollectionRole).value<Collection>();
A proxy model that filters collections by mime type.
Definition collectionfilterproxymodel.h:44
~CollectionFilterProxyModel() override
Destroys the collection proxy filter model.
QStringList mimeTypeFilters() const
Returns the list of mime type filters.
Definition collectionfilterproxymodel.cpp:123
CollectionFilterProxyModel(QObject *parent=nullptr)
Creates a new collection proxy filter model.
Definition collectionfilterproxymodel.cpp:97
void addMimeTypeFilters(const QStringList &mimeTypes)
Adds a list of mime types to be shown by the filter.
Definition collectionfilterproxymodel.cpp:105
void addMimeTypeFilter(const QString &mimeType)
Adds a mime type to be shown by the filter.
Definition collectionfilterproxymodel.cpp:112
void setExcludeVirtualCollections(bool exclude)
Sets whether we want virtual collections to be filtered or not.
Definition collectionfilterproxymodel.cpp:134
Helper for checking MIME types of Collections and Items.
Definition mimetypechecker.h:97
void addWantedMimeType(const QString &mimeType)
Adds another MIME type to the list of wanted MIME types this instance checks against.
Definition mimetypechecker.cpp:54
bool isWantedCollection(const Collection &collection) const
Checks whether a given collection has one of the wanted MIME types.
Definition mimetypechecker.cpp:78
Helper integration between Akonadi and Qt.
sourceModel
void append(QList< T > &&value)
void clear()
bool contains(const AT &value) const const
bool isValid() const const
QModelIndex parent() const const
int row() const const
QModelIndex sibling(int row, int column) const const
virtual Qt::ItemFlags flags(const QModelIndex &index) const const override
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
void invalidateFilter()
virtual QModelIndex mapToSource(const QModelIndex &proxyIndex) const const override
virtual QStringList mimeTypes() const const override
typedef ItemFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.