mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
filter: move shown_dive from divelist.c to divefilter.cpp
Arguably, the number of filtered dives is a matter of the divefilter. Let's move it there. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
9e84fd935b
commit
51d0c42a5c
5 changed files with 24 additions and 22 deletions
|
|
@ -786,22 +786,6 @@ void delete_single_dive(int idx)
|
|||
delete_dive_from_table(&dive_table, idx);
|
||||
}
|
||||
|
||||
int shown_dives = 0;
|
||||
bool filter_dive(struct dive *d, bool shown)
|
||||
{
|
||||
bool old_shown, changed;
|
||||
if (!d)
|
||||
return false;
|
||||
old_shown = !d->hidden_by_filter;
|
||||
d->hidden_by_filter = !shown;
|
||||
if (!shown && d->selected)
|
||||
deselect_dive(d);
|
||||
changed = old_shown != shown;
|
||||
if (changed)
|
||||
shown_dives += shown - old_shown;
|
||||
return changed;
|
||||
}
|
||||
|
||||
void process_loaded_dives()
|
||||
{
|
||||
int i;
|
||||
|
|
@ -1375,7 +1359,6 @@ void clear_dive_file_data()
|
|||
while (dive_table.nr)
|
||||
delete_single_dive(0);
|
||||
current_dive = NULL;
|
||||
shown_dives = 0;
|
||||
while (dive_site_table.nr)
|
||||
delete_dive_site(get_dive_site(0, &dive_site_table), &dive_site_table);
|
||||
if (trip_table.nr != 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue