From ca496c63aed2ff8c372baefee6a8b7a48402d081 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 24 Jun 2019 12:04:50 +0800 Subject: [PATCH] Desktop: fix time editing We were shifting in the wrong direction. Which caused the field to be marked as 'edited' again, which meant we shifted the wrong way and twice the distance. This seems to fix the problem for both date and time editing. Signed-off-by: Dirk Hohndel --- desktop-widgets/tab-widgets/maintab.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index ee246e3ab..7e8279a0b 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -814,7 +814,7 @@ static void shiftTime(QDateTime &dateTime) timestamp_t when = dateTime.toTime_t(); if (current_dive && current_dive->when != when) { - timestamp_t offset = current_dive->when - when; + timestamp_t offset = when - current_dive->when; Command::shiftTime(dives, (int)offset); } }