summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-20 17:25:13 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-10-20 17:34:53 -0700
commite1db94ea0c049184d06393e59843812c684f57cd (patch)
tree9d3f1d6ded421e5f50579b6de454aa1b8de27515 /qt-ui
parent4de44e6c9f2ef9c3ab8f5cef59e7a3fb04e08298 (diff)
downloadsubsurface-e1db94ea0c049184d06393e59843812c684f57cd.tar.gz
Correctly edit dive date/time when editing manually entered dives
While the existing code worked fine for editing that start date or time of dives downloaded from a dive computer or imported from some other source, for manually entered dives this did not work and the date or time was always reset to the original time once the changes were saved. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/maintab.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp
index 95ac0563d..4f253e150 100644
--- a/qt-ui/maintab.cpp
+++ b/qt-ui/maintab.cpp
@@ -973,22 +973,22 @@ void MainTab::on_dateEdit_dateChanged(const QDate &date)
{
if (editMode == IGNORE)
return;
+ markChangedWidget(ui.dateEdit);
QDateTime dateTime = QDateTime::fromTime_t(displayed_dive.when - gettimezoneoffset(displayed_dive.when));
dateTime.setTimeSpec(Qt::UTC);
dateTime.setDate(date);
- displayed_dive.when = dateTime.toTime_t();
- markChangedWidget(ui.dateEdit);
+ DivePlannerPointsModel::instance()->getDiveplan().when = displayed_dive.when = dateTime.toTime_t();
}
void MainTab::on_timeEdit_timeChanged(const QTime &time)
{
if (editMode == IGNORE)
return;
+ markChangedWidget(ui.timeEdit);
QDateTime dateTime = QDateTime::fromTime_t(displayed_dive.when - gettimezoneoffset(displayed_dive.when));
dateTime.setTimeSpec(Qt::UTC);
dateTime.setTime(time);
- displayed_dive.when = dateTime.toTime_t();
- markChangedWidget(ui.timeEdit);
+ DivePlannerPointsModel::instance()->getDiveplan().when = displayed_dive.when = dateTime.toTime_t();
}
// changing the tags on multiple dives is semantically strange - what's the right thing to do?