cleanup: move timestampToDateTime() to qthelper.cpp

Move this function from maintab.cpp to qthelper.cpp. Since the
functionality was used in numerous places, use the helper function
there as well. This removes a number of inconsistencies. For example,
sometime setTimeSpec(Qt::UTC) was called, even though the
QDateTime object was already created with that time spec.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2020-05-22 18:02:15 +02:00 committed by Dirk Hohndel
parent 2ba2ea934a
commit f63485b444
7 changed files with 22 additions and 28 deletions

View file

@ -865,7 +865,7 @@ void MainWindow::on_actionReplanDive_triggered()
graphics->clearHandlers();
setApplicationState(ApplicationState::PlanDive);
divePlannerWidget->setReplanButton(true);
divePlannerWidget->setupStartTime(QDateTime::fromMSecsSinceEpoch(1000 * current_dive->when, Qt::UTC));
divePlannerWidget->setupStartTime(timestampToDateTime(current_dive->when));
if (current_dive->surface_pressure.mbar)
divePlannerWidget->setSurfacePressure(current_dive->surface_pressure.mbar);
if (current_dive->salinity)