Commit 269edbb7 authored by Laurent Montel's avatar Laurent Montel 😁

Use QSortFilterProxyModel + recursive search

parent 0f8ce432
......@@ -22,7 +22,11 @@
#include <ChangeRecorder>
#include <EntityTreeModel>
#include <EntityRightsFilterModel>
#if (QT_VERSION < QT_VERSION_CHECK(5, 10, 0))
#include <KRecursiveFilterProxyModel>
#else
#include <QSortFilterProxyModel>
#endif
#include <KCheckableProxyModel>
#include <QLineEdit>
......@@ -48,7 +52,12 @@ public:
QTreeView *mFolderView;
QItemSelectionModel *mSelectionModel;
KCheckableProxyModel *mCheckProxy;
#if (QT_VERSION < QT_VERSION_CHECK(5, 10, 0))
KRecursiveFilterProxyModel *mCollectionFilter;
#else
QSortFilterProxyModel *mCollectionFilter = nullptr;
#endif
Akonadi::EntityTreeModel *mEntityTreeModel;
};
......@@ -81,10 +90,14 @@ CheckedCollectionWidget::CheckedCollectionWidget(const QString &mimetype, QWidge
d->mCheckProxy = new KCheckableProxyModel(this);
d->mCheckProxy->setSelectionModel(d->mSelectionModel);
d->mCheckProxy->setSourceModel(mimeTypeProxy);
#if (QT_VERSION < QT_VERSION_CHECK(5, 10, 0))
d->mCollectionFilter = new KRecursiveFilterProxyModel(this);
d->mCollectionFilter->setSourceModel(d->mCheckProxy);
d->mCollectionFilter->setDynamicSortFilter(true);
#else
d->mCollectionFilter = new QSortFilterProxyModel(this);
d->mCollectionFilter->setRecursiveFiltering(true);
#endif
d->mCollectionFilter->setSourceModel(d->mCheckProxy);
d->mCollectionFilter->setFilterCaseSensitivity(Qt::CaseInsensitive);
QLineEdit *searchLine = new QLineEdit(this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment