mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
5436f9b859
commit
ebfa366826
4 changed files with 144 additions and 116 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue