From c3b1c641837a441734ee9c525f5ed3699735c18c Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 27 Dec 2017 22:27:13 +0100 Subject: [PATCH] Remove unnecessary dynamic_cast<>s in filter code FilterModelBase is a direct subclass of QAbstractItemModel. Therefore, dynamic_cast<>ing the former to the latter is unnecessary. Probably an artifact of previous code. Signed-off-by: Berthold Stoeger --- qt-models/filtermodels.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/qt-models/filtermodels.cpp b/qt-models/filtermodels.cpp index 48a2fd9b9..cb83ce946 100644 --- a/qt-models/filtermodels.cpp +++ b/qt-models/filtermodels.cpp @@ -479,18 +479,14 @@ void MultiFilterSortModel::myInvalidate() void MultiFilterSortModel::addFilterModel(FilterModelBase *model) { - QAbstractItemModel *itemModel = dynamic_cast(model); - Q_ASSERT(itemModel); models.append(model); - connect(itemModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(myInvalidate())); + connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(myInvalidate())); } void MultiFilterSortModel::removeFilterModel(FilterModelBase *model) { - QAbstractItemModel *itemModel = dynamic_cast(model); - Q_ASSERT(itemModel); models.removeAll(model); - disconnect(itemModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(myInvalidate())); + disconnect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(myInvalidate())); } void MultiFilterSortModel::clearFilter()