[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
wilder
Laurent Montel 6 years ago
parent 83afe5d00c
commit 9cfbbf34f1
  1. 2
      CMakeLists.txt
  2. 2
      src/folder/entitycollectionorderproxymodel.h
  3. 2
      src/folder/favoritecollectionorderproxymodel.h
  4. 6
      src/folder/foldertreewidgetproxymodel.cpp
  5. 6
      src/folder/foldertreewidgetproxymodel.h

@ -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;

Loading…
Cancel
Save