diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-12-06 09:47:59 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-12-07 10:23:44 -0800 |
commit | f4f9ba9263c97a7c7612b68711a6c92c70d8721a (patch) | |
tree | 75d98986df501597c16e3b44117518190cb06862 /commands/command_divelist.cpp | |
parent | 84394adb11736de0fa37f7dfb7cf426fcd8f26f5 (diff) | |
download | subsurface-f4f9ba9263c97a7c7612b68711a6c92c70d8721a.tar.gz |
Selection: provide convenience function for single-dive selection
Currently, selecting a single dive or deselecting all dives was
quite awkward: One had to pass in a single-dive vector and the
dive itself (as current dive). Provide a convenience function
that selects a single dive or deselects all dives if null is
passed in.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'commands/command_divelist.cpp')
-rw-r--r-- | commands/command_divelist.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/commands/command_divelist.cpp b/commands/command_divelist.cpp index 12e1c9309..1d1a90387 100644 --- a/commands/command_divelist.cpp +++ b/commands/command_divelist.cpp @@ -574,10 +574,7 @@ void DeleteDive::redoit() timestamp_t when = divesToAdd.dives[0].dive->when; newCurrent = find_next_visible_dive(when); } - if (newCurrent) - setSelection(std::vector<dive *>{ newCurrent }, newCurrent); - else - setSelection(std::vector<dive *>(), nullptr); + select_single_dive(newCurrent); } |