mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive commands: set filter flag when adding dives
When adding dives to the list, set the filter flag accordingly. Thus, dives that are hidden by the filter are not shown on redo/undo. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
f836b9ae97
commit
11e0b7ac0a
1 changed files with 6 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
#include "core/divelist.h"
|
||||
#include "core/display.h" // for amount_selected
|
||||
#include "core/subsurface-qt/DiveListNotifier.h"
|
||||
#include "qt-models/filtermodels.h"
|
||||
|
||||
namespace Command {
|
||||
|
||||
|
@ -85,6 +86,11 @@ dive *DiveListBase::addDive(DiveToAdd &d)
|
|||
if (d.trip)
|
||||
add_dive_to_trip(d.dive.get(), d.trip);
|
||||
dive *res = d.dive.release(); // Give up ownership of dive
|
||||
|
||||
// Set the filter flag according to current filter settings
|
||||
bool show = MultiFilterSortModel::instance()->showDive(res);
|
||||
res->hidden_by_filter = !show;
|
||||
|
||||
add_single_dive(d.idx, res); // Return ownership to backend
|
||||
|
||||
// If the dive to be removed is selected, we will inform the frontend
|
||||
|
|
Loading…
Add table
Reference in a new issue