diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-06-22 14:05:46 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-09-29 16:13:03 -0700 |
commit | 38b686687faed3f8f60828105a2036d5f4e48db6 (patch) | |
tree | 5bbaa2f97566bb01a77a38906304470f62d9ae94 /desktop-widgets/filterwidget2.cpp | |
parent | 68fffc267212470f6d5eb218744b29a851f61cc2 (diff) | |
download | subsurface-38b686687faed3f8f60828105a2036d5f4e48db6.tar.gz |
cleanup: move shown-text calculation from filter widget to core
The filter widget was caching whether the filter was active and
used that flag to calculate the "# dives shown" string. Move this
directly to the DiveFilter class to remove interdependencies and
to unify with mobile.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/filterwidget2.cpp')
-rw-r--r-- | desktop-widgets/filterwidget2.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/desktop-widgets/filterwidget2.cpp b/desktop-widgets/filterwidget2.cpp index c51bef29a..26cb05c2a 100644 --- a/desktop-widgets/filterwidget2.cpp +++ b/desktop-widgets/filterwidget2.cpp @@ -10,8 +10,7 @@ FilterWidget2::FilterWidget2(QWidget* parent) : QWidget(parent), - ignoreSignal(false), - validFilter(false) + ignoreSignal(false) { ui.setupUi(this); @@ -194,7 +193,6 @@ void FilterWidget2::updateFilter() return; FilterData filterData = createFilterData(); - validFilter = filterData.validFilter(); DiveFilter::instance()->setFilter(filterData); } @@ -227,11 +225,3 @@ void FilterWidget2::addConstraint(filter_constraint_type type) { constraintModel.addConstraint(type); } - -QString FilterWidget2::shownText() -{ - if (validFilter) - return tr("%L1/%L2 shown").arg(shown_dives).arg(dive_table.nr); - else - return tr("%L1 dives").arg(dive_table.nr); -} |