Index: sources/view/settings/VDateTime.cpp =================================================================== diff -u -r611bbf4dcba67768db87cf30f21fd2db788f677d -r5b9ecb01e9dca6c67f8ecf66fa0c63ac34c820d9 --- sources/view/settings/VDateTime.cpp (.../VDateTime.cpp) (revision 611bbf4dcba67768db87cf30f21fd2db788f677d) +++ sources/view/settings/VDateTime.cpp (.../VDateTime.cpp) (revision 5b9ecb01e9dca6c67f8ecf66fa0c63ac34c820d9) @@ -36,9 +36,23 @@ connect(&_process, SIGNAL( finished(int)), this, SLOT(onSetDateUIFinished(int))); + + connect(&_process, SIGNAL( errorOccurred(QProcess::ProcessError)), + this, SLOT(onSetDateUIErrored(QProcess::ProcessError))); } /*! + * \brief VDateTime::onSetDateUIErrored + * The slot for when the set datetime script errors, log the error + */ +void VDateTime::onSetDateUIErrored(QProcess::ProcessError error){ + QString mScript = Storage::Scripts_Path_Name(); + mScript += Storage::Date_Time_Set_Sh; + LOG_DEBUG(QString("%1 errored. Error %2").arg(mScript).arg(error)); + //DEBUG: qDebug()<< QString("%1 errored. Error ").arg(mScript) << error; +} + +/*! * \brief VDateTime::doCurrentTime * Reads and displays the current date and time */ @@ -77,25 +91,30 @@ hour ( vHour ); minute ( vMinute ); - const QDateTime currentDateTimeLocal ( QDate(_year .toInt() , + QDateTime currentDateTimeLocal ( QDate(_year .toInt() , _month .toInt() , _day .toInt()), QTime(_hour .toInt() , _minute .toInt())); const QString dateTimeLocalStr = currentDateTimeLocal.toString(_Settings.getDatetimeFormat()); // Get the current UTC datetime - QDateTime currentDateTimeUTC(currentDateTimeLocal); + QDateTime currentDateTimeUTC = currentDateTimeLocal.toUTC(); currentDateTimeUTC.setTimeSpec(Qt::UTC); const quint32 epochUTC_sec = currentDateTimeUTC.toSecsSinceEpoch(); LOG_DEBUG(tr("SetDateTime %1").arg(dateTimeLocalStr)); - status("Setting date and time ..."); dateTimeUI(dateTimeLocalStr); dateTimeHD(epochUTC_sec ); dateTimeDG(epochUTC_sec ); + + //DEBUG: QDateTime convertBack; + //DEBUG: convertBack.setSecsSinceEpoch(epochUTC_sec); + //DEBUG: qDebug()<<"Secs since Epoch" << convertBack.toSecsSinceEpoch() << " UTC: " << convertBack.toUTC().toString(_Settings.getDatetimeFormat()); + + //DEBUG: qDebug() << "doConfirm RTC | epoch : " << epochUTC_sec << " | local: " << currentDateTimeLocal.toString(_Settings.getDatetimeFormat()) << " | current time zone: " << currentDateTimeLocal.timeZone() << " | UTC: " << currentDateTimeUTC.toString(_Settings.getDatetimeFormat()) ; } /*! @@ -255,16 +274,15 @@ static bool _hasDoneHDSyncRTC = false; if ( !_hasDoneHDSyncRTC ) { QDateTime hdRTCTime; - hdRTCTime.setSecsSinceEpoch(vData.mEpoch); hdRTCTime.setTimeSpec(Qt::UTC); + hdRTCTime.setSecsSinceEpoch(vData.mEpoch); QDateTime localDateTime = hdRTCTime.toLocalTime(); QString newDateTimeString = localDateTime.toString(_Settings.getDatetimeFormat()); dateTimeUI(newDateTimeString); - - //DEBUG: qDebug() << "Sync HD-UI RTC | HD Epoch: " << vData.mEpoch << " | HD datetime: " << hdRTCTime.toString(_Settings.getDatetimeFormat()) <<" | datetime : " << newDateTimeString; - _hasDoneHDSyncRTC = true; // indicate HD-UI RTC sync'd + + //DEBUG: qDebug() << "Sync HD->UI RTC | HD Epoch: " << vData.mEpoch << " | HD datetime: " << hdRTCTime.toString(_Settings.getDatetimeFormat()) <<" | local datetime : " << newDateTimeString; } }