mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
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:
parent
6cc5b601aa
commit
c3b1c64183
1 changed files with 2 additions and 6 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue