summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2015-08-31 20:58:31 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-08-31 18:41:47 -0700
commitdcda950202545f0ecbe6a1192ec5aaae4af19227 (patch)
treeac55e0af1789321bc773c9e9c91a6d32b16160a8 /qt-models
parent71e366a6e4cd1529eb336f68f239736125466fcf (diff)
downloadsubsurface-dcda950202545f0ecbe6a1192ec5aaae4af19227.tar.gz
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>
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/ssrfsortfilterproxymodel.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/qt-models/ssrfsortfilterproxymodel.cpp b/qt-models/ssrfsortfilterproxymodel.cpp
index 1a8c835dc..b1a84a3f2 100644
--- a/qt-models/ssrfsortfilterproxymodel.cpp
+++ b/qt-models/ssrfsortfilterproxymodel.cpp
@@ -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);
}