From: Enar Väikene Date: Tue, 10 Sep 2013 12:22:10 +0000 (+0300) Subject: When setting the current epoch, update the current date/time X-Git-Url: https://vaikene.ee/gitweb/pswgen04.html?a=commitdiff_plain;h=refs%2Fheads%2FScosTime;p=evaf When setting the current epoch, update the current date/time only if it was set from a CUC HEX string. --- 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);