diff options
| author | Josh Ferrell <josh@vector35.com> | 2026-01-26 14:23:12 -0500 |
|---|---|---|
| committer | Josh Ferrell <josh@vector35.com> | 2026-02-06 17:53:45 -0500 |
| commit | 70bbb18a9444824a8ec2b9a7ff57fc848e017b6e (patch) | |
| tree | fe87c0976b75a7557986d1ac6bcc2409a839624c /view/sharedcache/ui/dsctriage.h | |
| parent | 9b7604d13e8bd98c6998facb9326926ed96281b5 (diff) | |
Add regex and case sensitivity options to FilterEdit
Diffstat (limited to 'view/sharedcache/ui/dsctriage.h')
| -rw-r--r-- | view/sharedcache/ui/dsctriage.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/view/sharedcache/ui/dsctriage.h b/view/sharedcache/ui/dsctriage.h index 02a41eab..03eea6be 100644 --- a/view/sharedcache/ui/dsctriage.h +++ b/view/sharedcache/ui/dsctriage.h @@ -102,6 +102,8 @@ public: class FilterableTableView : public QTableView, public FilterTarget { Q_OBJECT + std::string m_filter; + FilterOptions m_filterOptions; bool m_filterByHiding; public: @@ -113,19 +115,22 @@ public: ~FilterableTableView() override = default; - void setFilter(const std::string& filter) override { + void setFilter(const std::string& filter, FilterOptions options) override { + m_filter = filter; + m_filterOptions = options; + QString qFilter = QString::fromStdString(m_filter); if (!m_filterByHiding) { - emit filterTextChanged(QString::fromStdString(filter)); + emit filterTextChanged(qFilter); return; } - QString qFilter = QString::fromStdString(filter); + bool caseSensitive = options.testFlag(CaseSensitiveOption); for (int row = 0; row < model()->rowCount(); ++row) { bool match = false; for (int col = 0; col < model()->columnCount(); ++col) { QModelIndex index = model()->index(row, col); QString data = model()->data(index).toString(); - if (data.contains(qFilter, Qt::CaseInsensitive)) { + if (data.contains(qFilter, caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive)) { match = true; break; } |
