| 59 | } |
| 60 | |
| 61 | bool FilterModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const |
| 62 | { |
| 63 | if (searchTerm.isEmpty()) { |
| 64 | return true; |
| 65 | } |
| 66 | |
| 67 | auto index = sourceModel()->index(sourceRow, 0, sourceParent); |
| 68 | auto pack = sourceModel()->data(index, Qt::UserRole).value<ModpacksCH::Modpack>(); |
| 69 | return pack.name.contains(searchTerm, Qt::CaseInsensitive); |
| 70 | } |
| 71 | |
| 72 | bool FilterModel::lessThan(const QModelIndex &left, const QModelIndex &right) const |
| 73 | { |