You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
522 B
18 lines
522 B
4 years ago
|
// SPDX-License-Identifier: BSD-3-Clause
|
||
|
// Copyright (c) 2020, The Monero Project.
|
||
|
|
||
|
#include "CoinsProxyModel.h"
|
||
|
#include "CoinsModel.h"
|
||
|
|
||
|
CoinsProxyModel::CoinsProxyModel(QObject *parent)
|
||
|
: QSortFilterProxyModel(parent)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
bool CoinsProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
|
||
|
{
|
||
|
QModelIndex spentIndex = sourceModel()->index(sourceRow, CoinsModel::Spent, sourceParent);
|
||
|
bool isSpent = sourceModel()->data(spentIndex).toBool();
|
||
|
|
||
|
return !(!m_showSpent && isSpent);
|
||
|
}
|