Desktop: track if the filter widget is active

This is not perfect - if you open the filter, set some criterion and then
remove it again (without resetting the filter), this variable will give you a
false positive).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2019-02-18 12:43:34 -08:00
parent 0d7d347952
commit 106c682c03
2 changed files with 9 additions and 1 deletions

View file

@ -6,7 +6,9 @@
#include <QDoubleSpinBox>
FilterWidget2::FilterWidget2(QWidget* parent) : QWidget(parent), ignoreSignal(false)
FilterWidget2::FilterWidget2(QWidget* parent) :
QWidget(parent),
ignoreSignal(false)
{
ui.setupUi(this);
@ -231,3 +233,8 @@ void FilterWidget2::countsChanged()
ui.filterText->setText(tr("%L1/%L2 shown").arg(MultiFilterSortModel::instance()->divesDisplayed)
.arg(dive_table.nr));
}
bool FilterWidget2::isActive() const
{
return filterData.validFilter;
}

View file

@ -35,6 +35,7 @@ private slots:
private:
bool ignoreSignal;
bool isActive() const;
Ui::FilterWidget2 ui;
void filterDataChanged(const FilterData &data);
FilterData filterData;