Commit 905746de authored by Jasem Mutlaq's avatar Jasem Mutlaq

Update device time if KStars time is updated when applicable

parent 9498c39a
......@@ -48,6 +48,18 @@ GenericDevice::GenericDevice(DeviceInfo &idv)
dType = KSTARS_UNKNOWN;
registerDBusType();
// JM 2020-09-05: In case KStars time change, update driver time if applicable.
connect(KStarsData::Instance()->clock(), &SimClock::timeChanged, [this]()
{
if (baseDevice && baseDevice->isConnected() && Options::useTimeUpdate() && Options::useKStarsSource())
{
ITextVectorProperty *tvp = baseDevice->getText("TIME_UTC");
if (tvp && tvp->p != IP_RO)
updateTime();
}
});
}
void GenericDevice::registerDBusType()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment