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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2017-12-27 22:27:13 +01:00 committed by Jan Mulder
parent 6cc5b601aa
commit c3b1c64183

View file

@ -479,18 +479,14 @@ void MultiFilterSortModel::myInvalidate()
void MultiFilterSortModel::addFilterModel(FilterModelBase *model)
{
QAbstractItemModel *itemModel = dynamic_cast<QAbstractItemModel *>(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<QAbstractItemModel *>(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()