1#include "ShaFilterProxyModel.h"
2
3#include <CommitHistoryColumns.h>
4
5ShaFilterProxyModel::ShaFilterProxyModel(QObject *parent)
6 : QSortFilterProxyModel(parent)
7{
8}
9
10bool ShaFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
11{
12 const auto shaIndex = sourceModel()->index(sourceRow, static_cast<int>(CommitHistoryColumns::Sha), sourceParent);
13 const auto sha = sourceModel()->data(shaIndex).toString();
14 return mAcceptedShas.contains(sha);
15}
16