subsurface/commands
Berthold Stoeger 4a165980e7 undo: pass dive as unique_ptr to addDive()
Before, a non-owning pointer was passed and the dive moved
away from the dive. Instead, let the caller decide if they
still want to keep a copy of the dive, or give up ownership:

In MainWindow and QMLManager new dives are generated, so
one might just as well give up ownership. In contrast,
the planner works on a copy (originally the infamous
"displayed_dive") and now moves the data manually.

This commit also removes duplicate code, by moving the
"create default dive" code from MainWindow and QMLManager
to struct dive.

Finally, determination of the "time zone offset" is not done
in POSIX, since we want to avoid calls form the core into
Qt.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-08-13 19:28:30 +02:00
..
CMakeLists.txt undo: add device related undo commands 2020-10-25 13:59:04 -07:00
command.cpp undo: pass dive as unique_ptr to addDive() 2024-08-13 19:28:30 +02:00
command.h undo: pass dive as unique_ptr to addDive() 2024-08-13 19:28:30 +02:00
command_base.cpp core: turn C dive-table into an owning table 2024-08-13 19:28:30 +02:00
command_base.h core: turn dive-trip location and notes into std::string 2024-08-13 19:28:30 +02:00
command_device.cpp core: remove device C access code 2024-08-13 19:28:30 +02:00
command_device.h undo/device: adjust device management infrastructure 2021-08-18 13:22:02 -07:00
command_divelist.cpp undo: pass dive as unique_ptr to addDive() 2024-08-13 19:28:30 +02:00
command_divelist.h undo: pass dive as unique_ptr to addDive() 2024-08-13 19:28:30 +02:00
command_divesite.cpp core: include divesite table directly in divelog 2024-08-13 19:28:30 +02:00
command_divesite.h core: replace divesite_table_t by a vector of std::unique_ptr<>s 2024-08-13 19:28:30 +02:00
command_edit.cpp core: make calculate_cns() member of dive_table 2024-08-13 19:28:30 +02:00
command_edit.h core: turn struct dive string data into std::string 2024-08-13 19:28:30 +02:00
command_edit_trip.cpp core: turn dive-trip location and notes into std::string 2024-08-13 19:28:30 +02:00
command_edit_trip.h core: turn dive-trip location and notes into std::string 2024-08-13 19:28:30 +02:00
command_event.cpp core: turn event-list of divecomputer into std::vector<> 2024-08-13 19:28:30 +02:00
command_event.h core: turn event-list of divecomputer into std::vector<> 2024-08-13 19:28:30 +02:00
command_filter.cpp core: remove filterconstraint C boilerplate code 2024-08-13 19:28:30 +02:00
command_filter.h core: port filterpreset.cpp to std::string 2024-03-10 11:01:42 +13:00
command_pictures.cpp core: include divesite table directly in divelog 2024-08-13 19:28:30 +02:00
command_pictures.h core: convert taxonomy.c to C++ 2024-08-13 19:28:30 +02:00