Fixes a bug where sorters wouldn't get cleared

This bug was exposed by commit 9a72c73226ce193c733513484ecf9292bce8601b
Also fixes a cosmetic typo in a variable name
This commit is contained in:
Pierre-Yves Siret 2017-01-24 19:16:35 +01:00
parent 9a72c73226
commit 8fc7679ab8

View File

@ -302,16 +302,16 @@ int QQmlSortFilterProxyModel::count_sorter(QQmlListProperty<Sorter>* list)
return sorters->count();
}
Sorter *QQmlSortFilterProxyModel::at_sorter(QQmlListProperty<Sorter>* list, int index)
Sorter* QQmlSortFilterProxyModel::at_sorter(QQmlListProperty<Sorter>* list, int index)
{
auto filters = static_cast<QList<Sorter*>*>(list->data);
return filters->at(index);
auto sorters = static_cast<QList<Sorter*>*>(list->data);
return sorters->at(index);
}
void QQmlSortFilterProxyModel::clear_sorters(QQmlListProperty<Sorter>* list)
{
auto that = static_cast<QQmlSortFilterProxyModel*>(list->object);
that->m_filters.clear();
that->m_sorters.clear();
that->invalidate();
}