Revert "Port away from deprecated QConcatenateTablesProxyModel"

This reverts commit 25f4cce3bf.
wilder-5.24
Alexander Lohnau 4 years ago
parent c3201e74c2
commit 0458f3293d
  1. 1
      CMakeLists.txt
  2. 4
      applets/kicker/plugin/computermodel.cpp
  3. 4
      applets/kicker/plugin/computermodel.h
  4. 12
      libnotificationmanager/notifications.cpp
  5. 7
      libnotificationmanager/utils.cpp
  6. 2
      libtaskmanager/concatenatetasksproxymodel.cpp
  7. 6
      libtaskmanager/concatenatetasksproxymodel.h

@ -186,6 +186,7 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00) add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055800) add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055800)
add_definitions(-DKITEMMODELS_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054F00)
configure_file(config-workspace.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-workspace.h) configure_file(config-workspace.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-workspace.h)
configure_file(config-unix.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-unix.h ) configure_file(config-unix.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-unix.h )

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

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

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

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

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

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

Loading…
Cancel
Save