From 4e8a8e8bba08252b1976428942a089fd560d19d9 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Enar=20V=C3=A4ikene?= <enar@vaikene.net>
Date: Tue, 10 Sep 2013 15:22:10 +0300
Subject: [PATCH] When setting the current epoch, update the current date/time
 only if it was set from a CUC HEX string.

---
 src/apps/ScosTime/gui.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/apps/ScosTime/gui.cpp b/src/apps/ScosTime/gui.cpp
index ed7f098..74d980e 100644
--- a/src/apps/ScosTime/gui.cpp
+++ b/src/apps/ScosTime/gui.cpp
@@ -91,7 +91,8 @@ void Internal::DateTime::setEpoch(QDateTime const & epoch)
 
     if (epoch != mEpoch)
     {
-        if (mDateTime.isValid())
+        // Adjust the date/time if the value was set from a CUC HEX string
+        if (mType == CUC && mDateTime.isValid())
         {
             qint64 diff = mEpoch.msecsTo(epoch);
             mDateTime = mDateTime.addMSecs(diff);
-- 
2.49.0