diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-03-01 15:32:24 +0100 |
---|---|---|
committer | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-04-07 00:13:35 +0200 |
commit | 01fa983182062e00b2e661a963384289e4de1beb (patch) | |
tree | c53a791b458fc0841f3e1c83f534711129456b58 /qt-models/cylindermodel.h | |
parent | 1dcc885bb257d6c8c64074f8788b468397c34aaa (diff) | |
download | subsurface-01fa983182062e00b2e661a963384289e4de1beb.tar.gz |
undo/cylinder: call undo command to edit cylinder fields
Call an undo command when editing cylinders, but only if on
the EquipmentTab.
To keep code changes small, make a copy of the cylinder first,
then edit the cylinder as before and then either call an undo
command (EquipmentTab) or overwrite the old cylinder (Planner).
The memory management here is a bit strange: Since the undo-command
itself makes a deep-copy of the passed in cylinder, we only do
a shallow copy. If we have to change the type, we allocate the
string with an std::string, so that the memory is automatically
freed at the end of the function. However, this means that in
the planner we have to make a deep copy first, swap old and
new cylinder and finally release the old cylinder. Certainly
not ideal, but for now the pragmatic thing to do.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'qt-models/cylindermodel.h')
0 files changed, 0 insertions, 0 deletions