Port away from deprecated QConcatenateTablesProxyModel

wilder-5.24
Alexander Lohnau 4 years ago
parent 0dbec4febf
commit 25f4cce3bf
  1. 4
      applets/kicker/plugin/computermodel.cpp
  2. 4
      applets/kicker/plugin/computermodel.h
  3. 12
      libnotificationmanager/notifications.cpp
  4. 7
      libnotificationmanager/utils.cpp
  5. 2
      libtaskmanager/concatenatetasksproxymodel.cpp
  6. 6
      libtaskmanager/concatenatetasksproxymodel.h

@ -12,10 +12,10 @@
#include <QIcon>
#include <KAuthorized>
#include <KConcatenateRowsProxyModel>
#include <KFilePlacesModel>
#include <KIO/OpenUrlJob>
#include <KLocalizedString>
#include <QConcatenateTablesProxyModel>
#include <Solid/Device>
#include "krunner_interface.h"
@ -123,7 +123,7 @@ Q_INVOKABLE bool RunCommandModel::trigger(int row, const QString &actionId, cons
ComputerModel::ComputerModel(QObject *parent)
: ForwardingModel(parent)
, m_concatProxy(new KConcatenateRowsProxyModel(this))
, m_concatProxy(new QConcatenateTablesProxyModel(this))
, m_runCommandModel(new RunCommandModel(this))
, m_systemAppsModel(new SimpleFavoritesModel(this))
, m_filteredPlacesModel(new FilteredPlacesModel(this))

@ -14,7 +14,7 @@
class SimpleFavoritesModel;
class KConcatenateRowsProxyModel;
class QConcatenateTablesProxyModel;
class KFilePlacesModel;
namespace Solid
@ -95,7 +95,7 @@ private Q_SLOTS:
void onSetupDone(Solid::ErrorType error, QVariant errorData, const QString &udi);
private:
KConcatenateRowsProxyModel *m_concatProxy;
QConcatenateTablesProxyModel *m_concatProxy;
RunCommandModel *m_runCommandModel;
SimpleFavoritesModel *m_systemAppsModel;
FilteredPlacesModel *m_filteredPlacesModel;

@ -6,11 +6,11 @@
#include "notifications.h"
#include <QConcatenateTablesProxyModel>
#include <QDebug>
#include <QMetaEnum>
#include <QSharedPointer>
#include <KConcatenateRowsProxyModel>
#include <KDescendantsProxyModel>
#include "limitedrowcountproxymodel_p.h"
@ -67,7 +67,7 @@ public:
JobsModel::Ptr jobsModel;
QSharedPointer<Settings> settings() const;
KConcatenateRowsProxyModel *notificationsAndJobsModel = nullptr;
QConcatenateTablesProxyModel *notificationsAndJobsModel = nullptr;
NotificationFilterProxyModel *filterModel = nullptr;
NotificationSortProxyModel *sortModel = nullptr;
@ -125,7 +125,7 @@ void Notifications::Private::initProxyModels()
* NotificationsModel JobsModel
* \\ /
* \\ /
* KConcatenateRowsProxyModel
* QConcatenateTablesProxyModel
* |||
* |||
* NotificationFilterProxyModel
@ -158,7 +158,7 @@ void Notifications::Private::initProxyModels()
*/
if (!notificationsAndJobsModel) {
notificationsAndJobsModel = new KConcatenateRowsProxyModel(q);
notificationsAndJobsModel = new QConcatenateTablesProxyModel(q);
}
if (!filterModel) {
@ -344,8 +344,8 @@ QModelIndex Notifications::Private::mapFromModel(const QModelIndex &idx) const
found = true;
break;
}
} else if (auto *concatenateModel = qobject_cast<KConcatenateRowsProxyModel *>(model)) {
// There's no "sourceModels()" on KConcatenateRowsProxyModel
} else if (auto *concatenateModel = qobject_cast<QConcatenateTablesProxyModel *>(model)) {
// There's no "sourceModels()" on QConcatenateTablesProxyModel
if (idxModel == notificationsModel.data() || idxModel == jobsModel.data()) {
resolvedIdx = concatenateModel->mapFromSource(resolvedIdx);
found = true;

@ -10,6 +10,7 @@
#include <QAbstractItemModel>
#include <QAbstractProxyModel>
#include <QConcatenateTablesProxyModel>
#include <QCoreApplication>
#include <QDBusConnection>
#include <QDBusConnectionInterface>
@ -19,8 +20,6 @@
#include <QSettings>
#include <QTextStream>
#include <KConcatenateRowsProxyModel>
#include <KProcessList>
using namespace NotificationManager;
@ -109,8 +108,8 @@ QModelIndex Utils::mapToModel(const QModelIndex &idx, const QAbstractItemModel *
while (resolvedIdx.isValid() && resolvedIdx.model() != sourceModel) {
if (auto *proxyModel = qobject_cast<const QAbstractProxyModel *>(resolvedIdx.model())) {
resolvedIdx = proxyModel->mapToSource(resolvedIdx);
// KConcatenateRowsProxyModel isn't a "real" proxy model, so we need to special case for it :(
} else if (auto *concatenateModel = qobject_cast<const KConcatenateRowsProxyModel *>(resolvedIdx.model())) {
// QConcatenateTablesProxyModel isn't a "real" proxy model, so we need to special case for it :(
} else if (auto *concatenateModel = qobject_cast<const QConcatenateTablesProxyModel *>(resolvedIdx.model())) {
resolvedIdx = concatenateModel->mapToSource(resolvedIdx);
} else {
if (resolvedIdx.model() != sourceModel) {

@ -9,7 +9,7 @@
namespace TaskManager
{
ConcatenateTasksProxyModel::ConcatenateTasksProxyModel(QObject *parent)
: KConcatenateRowsProxyModel(parent)
: QConcatenateTablesProxyModel(parent)
{
}

@ -8,7 +8,7 @@
#include "abstracttasksproxymodeliface.h"
#include <KConcatenateRowsProxyModel>
#include <QConcatenateTablesProxyModel>
#include "taskmanager_export.h"
@ -17,13 +17,13 @@ namespace TaskManager
/**
* @short A proxy tasks model for concatenating multiple source tasks models.
*
* This proxy model is a subclass of KConcatenateRowsProxyModel implementing
* This proxy model is a subclass of QConcatenateTablesProxyModel implementing
* AbstractTasksModelIface, forwarding calls to the correct source model.
*
* @author Eike Hein <hein@kde.org>
**/
class TASKMANAGER_EXPORT ConcatenateTasksProxyModel : public KConcatenateRowsProxyModel, public AbstractTasksProxyModelIface
class TASKMANAGER_EXPORT ConcatenateTasksProxyModel : public QConcatenateTablesProxyModel, public AbstractTasksProxyModelIface
{
Q_OBJECT

Loading…
Cancel
Save