diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2019-02-17 10:18:00 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2019-04-12 18:19:07 +0300 |
commit | ebfa36682602de1ed5c6ae53aabaf68b0b7f3b24 (patch) | |
tree | b8b2aeb1b5dcf2b98496a9b36a4cdc68295af7d0 /desktop-widgets/command_private.h | |
parent | 5436f9b8590e6022ce2dabefb23ffb037020784a (diff) | |
download | subsurface-ebfa36682602de1ed5c6ae53aabaf68b0b7f3b24.tar.gz |
Undo: move selection function into command_private.cpp file
Undo of editing should probably also restore the old selection and
current dive. Therefore, move the functions that set and restore the
selection and the current dive from the command_divelist.cpp into the
command_private.cpp translation unit.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/command_private.h')
-rw-r--r-- | desktop-widgets/command_private.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/desktop-widgets/command_private.h b/desktop-widgets/command_private.h index 06e4516c1..a75ff9bba 100644 --- a/desktop-widgets/command_private.h +++ b/desktop-widgets/command_private.h @@ -4,13 +4,12 @@ #ifndef COMMAND_PRIVATE_H #define COMMAND_PRIVATE_H +#include "core/dive.h" + #include <vector> #include <utility> #include <QVector> -struct dive; -struct dive_trip; - namespace Command { // Generally, signals are sent in batches per trip. To avoid writing the same loop @@ -56,6 +55,14 @@ void processByTrip(Vector &divesIn, Function action) } +// Reset the selection to the dives of the "selection" vector and send the appropriate signals. +// Set the current dive to "currentDive". "currentDive" must be an element of "selection" (or +// null if "seletion" is empty). Return true if the selection or current dive changed. +bool setSelection(const std::vector<dive *> &selection, dive *currentDive); + +// Get currently selectd dives +std::vector<dive *> getDiveSelection(); + } // namespace Command #endif // COMMAND_PRIVATE_H |