Commit 7827088b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

[kdepim-runtime] Port to QSortFilterProxyModel from deprecated KRecursiveFilterProxyModel

Summary:
following https://phabricator.kde.org/D25595

WARNING: don't merge this until D25595 is accepted and merged

Reviewers: dvratil, winterz

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D25598
parent 80605d5d
......@@ -68,7 +68,7 @@ set(QT_REQUIRED_VERSION "5.12.0")
set(KDEPIMRUNTIME_LIB_VERSION "${KDEPIM_RUNTIME_VERSION_NUMBER}")
set(KDEPIMRUNTIME_LIB_SOVERSION "5")
set(AKONADI_VERSION "5.13.40")
set(AKONADI_VERSION "5.13.41")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.13.40")
set(KMAILTRANSPORT_LIB_VERSION "5.13.40")
......
......@@ -24,19 +24,19 @@
#include <QHeaderView>
#include <QLineEdit>
#include <QPushButton>
#include <QSortFilterProxyModel>
#include <QStandardItemModel>
#include <QTreeView>
#include <QVBoxLayout>
#include <KMessageWidget>
#include <KLocalizedString>
#include <KRecursiveFilterProxyModel>
#include "ewsclient.h"
#include "ewsfindfolderrequest.h"
#include "ewssubscribedfoldersjob.h"
#include "ewssettings.h"
class EwsSubscriptionFilterModel : public KRecursiveFilterProxyModel
class EwsSubscriptionFilterModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
......@@ -95,9 +95,10 @@ public:
};
EwsSubscriptionFilterModel::EwsSubscriptionFilterModel(QObject *parent)
: KRecursiveFilterProxyModel(parent)
: QSortFilterProxyModel(parent)
, mFilterSelected(false)
{
setRecursiveFilteringEnabled(true);
}
EwsSubscriptionFilterModel::~EwsSubscriptionFilterModel()
......@@ -117,7 +118,7 @@ bool EwsSubscriptionFilterModel::filterAcceptsRow(int sourceRow, const QModelInd
if (!show) {
return false;
} else {
return KRecursiveFilterProxyModel::filterAcceptsRow(sourceRow, sourceParent);
return QSortFilterProxyModel::filterAcceptsRow(sourceRow, sourceParent);
}
}
......
......@@ -325,8 +325,9 @@ void SubscriptionDialog::applyChanges()
}
SubscriptionFilterProxyModel::SubscriptionFilterProxyModel(QObject *parent)
: KRecursiveFilterProxyModel(parent)
: QSortFilterProxyModel(parent)
{
setRecursiveFilteringEnabled(true);
}
void SubscriptionFilterProxyModel::setSearchPattern(const QString &pattern)
......@@ -351,7 +352,7 @@ void SubscriptionFilterProxyModel::setIncludeCheckedOnly(int checkedOnlyState)
invalidate();
}
bool SubscriptionFilterProxyModel::acceptRow(int sourceRow, const QModelIndex &sourceParent) const
bool SubscriptionFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
{
QModelIndex sourceIndex = sourceModel()->index(sourceRow, 0, sourceParent);
......
......@@ -23,8 +23,8 @@
#define SUBSCRIPTIONDIALOG_H
#include <QDialog>
#include <QSortFilterProxyModel>
#include <krecursivefilterproxymodel.h>
#include <kimap/listjob.h>
#include <QMap>
......@@ -38,7 +38,7 @@ class ImapAccount;
class QTreeView;
class QPushButton;
class SubscriptionFilterProxyModel : public KRecursiveFilterProxyModel
class SubscriptionFilterProxyModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
......@@ -50,7 +50,7 @@ public Q_SLOTS:
void setIncludeCheckedOnly(int checkedOnlyState);
protected:
bool acceptRow(int sourceRow, const QModelIndex &sourceParent) const override;
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
private:
QString m_pattern;
......
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