mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Fix recursive stack-overflow
Only call this when needed, if there's no function set as callback, always return true. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
71e366a6e4
commit
dcda950202
1 changed files with 4 additions and 2 deletions
|
@ -14,14 +14,16 @@ bool SsrfSortFilterProxyModel::lessThan(const QModelIndex& source_left, const QM
|
|||
|
||||
bool SsrfSortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const
|
||||
{
|
||||
Q_ASSERT(accepts_row);
|
||||
if (!accepts_row)
|
||||
return true;
|
||||
const QAbstractItemModel *self = this;
|
||||
return accepts_row(const_cast<QAbstractItemModel*>(self), source_row, source_parent);
|
||||
}
|
||||
|
||||
bool SsrfSortFilterProxyModel::filterAcceptsColumn(int source_column, const QModelIndex& source_parent) const
|
||||
{
|
||||
Q_ASSERT(accepts_col);
|
||||
if (!accepts_col)
|
||||
return true;
|
||||
const QAbstractItemModel *self = this;
|
||||
return accepts_col(const_cast<QAbstractItemModel*>(self), source_column, source_parent);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue