Commit 9cfbbf34 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

[mailcommon] 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/D25596
parent 83afe5d0
......@@ -37,7 +37,7 @@ set(MAILIMPORTER_LIB_VERSION "5.13.40")
set(LIBKDEPIM_LIB_VERSION "5.13.40")
set(PIMCOMMON_LIB_VERSION "5.13.40")
set(AKONADI_VERSION "5.13.40")
set(AKONADI_VERSION "5.13.41")
set(AKONADIMIME_LIB_VERSION "5.13.40")
set(MESSAGELIB_LIB_VERSION "5.13.40")
set(KMIME_LIB_VERSION "5.13.40")
......
......@@ -20,8 +20,8 @@
#ifndef MAILCOMMON_ENTITYCOLLECTIONORDERPROXYMODEL_H
#define MAILCOMMON_ENTITYCOLLECTIONORDERPROXYMODEL_H
#include <EntityOrderProxyModel>
#include "mailcommon_export.h"
#include <EntityOrderProxyModel>
namespace MailCommon {
/**
......
......@@ -20,8 +20,8 @@
#ifndef MAILCOMMON_FAVORITECOLLECTIONORDERPROXYMODEL_H
#define MAILCOMMON_FAVORITECOLLECTIONORDERPROXYMODEL_H
#include <EntityOrderProxyModel>
#include "mailcommon_export.h"
#include <EntityOrderProxyModel>
namespace MailCommon {
/**
......
......@@ -126,7 +126,7 @@ Qt::ItemFlags FolderTreeWidgetProxyModel::flags(const QModelIndex &index) const
if (!MailCommon::Util::isVirtualCollection(collection)) {
const Akonadi::AgentInstance instance = Akonadi::AgentManager::self()->instance(collection.resource());
if (instance.status() == Akonadi::AgentInstance::Broken) {
return KRecursiveFilterProxyModel::flags(sourceIndex) & ~(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
return QSortFilterProxyModel::flags(sourceIndex) & ~(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
}
}
return Akonadi::EntityRightsFilterModel::flags(index);
......@@ -190,7 +190,7 @@ bool FolderTreeWidgetProxyModel::hideOutboxFolder() const
return d->hideOutboxFolder;
}
bool FolderTreeWidgetProxyModel::acceptRow(int sourceRow, const QModelIndex &sourceParent) const
bool FolderTreeWidgetProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
{
const QModelIndex modelIndex = sourceModel()->index(sourceRow, 0, sourceParent);
......@@ -221,7 +221,7 @@ bool FolderTreeWidgetProxyModel::acceptRow(int sourceRow, const QModelIndex &sou
}
}
return KRecursiveFilterProxyModel::acceptRow(sourceRow, sourceParent);
return EntityRightsFilterModel::filterAcceptsRow(sourceRow, sourceParent);
}
QVariant FolderTreeWidgetProxyModel::data(const QModelIndex &index, int role) const
......
......@@ -20,9 +20,10 @@
#ifndef MAILCOMMON_FOLDERTREEWIDGETPROXYMODEL_H
#define MAILCOMMON_FOLDERTREEWIDGETPROXYMODEL_H
#include "mailcommon_export.h"
#include <Collection>
#include <EntityRightsFilterModel>
#include "mailcommon_export.h"
namespace MailCommon {
/**
......@@ -69,8 +70,9 @@ public:
void readConfig();
void setWarningThreshold(qreal threshold);
protected:
bool acceptRow(int sourceRow, const QModelIndex &sourceParent) const override;
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
private:
class Private;
......
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