subsurface/mobile-widgets
Berthold Stoeger 152e6966c9 fix copy/paste of dive-site
The copy/pasting of dive-sites was fundamentally broken in at least two
ways:

1) The dive-site pointer in struct dive was simply overwritten, which
   breaks internal consistency. Also, no dive-site changed signals where
   sent.

2) The copied dive-site was stored as a pointer in a struct dive. Thus,
   the user could copy a dive, then delete the dive-site and paste.
   This would lead to a dangling pointer and ultimately crash the
   application.

Fix this by storing the UUID of the dive-site, not a pointer.
To do that, don't store a copy of the dive, but collect all
the data in a `dive_paste_data` structure.
If the dive site has been deleted on paste, do nothing.
Send the appropriate signals on pasting.

The mobile version had an additional bug: It kept a pointer to the
dive to be copied, which might become stale by undo.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-08-17 23:34:16 +12:00
..
3rdparty mobile/UI: correctly update title bar font size 2021-01-19 12:42:48 -08:00
qml fix copy/paste of dive-site 2024-08-17 23:34:16 +12:00
CMakeLists.txt
qmlinterface.cpp Mobile: Fix Gradient Factor Preference Setting. 2024-01-27 20:55:32 -08:00
qmlinterface.h Mobile: Fix Gradient Factor Preference Setting. 2024-01-27 20:55:32 -08:00
qmlmanager.cpp fix copy/paste of dive-site 2024-08-17 23:34:16 +12:00
qmlmanager.h fix copy/paste of dive-site 2024-08-17 23:34:16 +12:00
statsmanager.cpp cleanup: replace fprintf to stderr by report_info() 2024-04-23 07:47:11 +07:00
statsmanager.h statistics: switch themes on the mobile version 2022-03-16 15:26:54 -07:00
themeinterface.cpp core: move floating point functions to own header file 2022-08-30 22:34:38 +02:00
themeinterface.h cleanup: replace function static variable by member variable 2022-03-16 15:26:54 -07:00