mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Correctly limit overview transaction list
The way that the main overview page limits the number of transactions displayed (currently 5) is not an appropriate use of Qt. If it's run with a DEBUG build of Qt, it'll result in a segfault in certain relatively common situations. Instead of artificially limiting the rowCount() in the subclassed proxy filter, we hide/unhide the rows in the displaying QListView upon any changes in the sorted proxy filter.
This commit is contained in:
@@ -88,25 +88,8 @@ void TransactionFilterProxy::setWatchOnlyFilter(WatchOnlyFilter filter)
|
||||
invalidateFilter();
|
||||
}
|
||||
|
||||
void TransactionFilterProxy::setLimit(int limit)
|
||||
{
|
||||
this->limitRows = limit;
|
||||
}
|
||||
|
||||
void TransactionFilterProxy::setShowInactive(bool _showInactive)
|
||||
{
|
||||
this->showInactive = _showInactive;
|
||||
invalidateFilter();
|
||||
}
|
||||
|
||||
int TransactionFilterProxy::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
if(limitRows != -1)
|
||||
{
|
||||
return std::min(QSortFilterProxyModel::rowCount(parent), limitRows);
|
||||
}
|
||||
else
|
||||
{
|
||||
return QSortFilterProxyModel::rowCount(parent);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user