aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-10-30 22:10:31 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-12-29 08:34:09 -0800
commitc53bab8965a2d5332df55a442a999714b5f700dc (patch)
treee6fa9c5e6aea6936dea619fb5148874bc0652e6b /commands
parent51d0c42a5c826350ba189abaf0f57ef1b35381f3 (diff)
downloadsubsurface-c53bab8965a2d5332df55a442a999714b5f700dc.tar.gz
filter: internalize shown_dives in DiveFilter class
one piece of global state removed! Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'commands')
-rw-r--r--commands/command_divelist.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/commands/command_divelist.cpp b/commands/command_divelist.cpp
index 36d4cdcf3..baf81c1ac 100644
--- a/commands/command_divelist.cpp
+++ b/commands/command_divelist.cpp
@@ -130,7 +130,7 @@ DivesAndTripsToAdd DiveListBase::removeDives(DivesAndSitesToRemove &divesAndSite
sitesToAdd.reserve(divesAndSitesToDelete.sites.size());
// Remember old number of shown dives
- int oldShown = shown_dives;
+ int oldShown = DiveFilter::instance()->shownDives();
// Make sure that the dive list is sorted. The added dives will be sent in a signal
// and the recipients assume that the dives are sorted the same way as they are
@@ -164,7 +164,7 @@ DivesAndTripsToAdd DiveListBase::removeDives(DivesAndSitesToRemove &divesAndSite
emit diveListNotifier.divesDeleted(trip, deleteTrip, divesInTrip);
});
- if (oldShown != shown_dives)
+ if (oldShown != DiveFilter::instance()->shownDives())
emit diveListNotifier.numShownChanged();
return { std::move(divesToAdd), std::move(tripsToAdd), std::move(sitesToAdd) };