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>
Return an std::string to avoid memory management headaches.
While doing that, convert time.c to C++ so that
format_datetime directly returns an std::string.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>