Index: sources/view/settings/VDateTime.cpp =================================================================== diff -u -r506a9e3db1a20bda1685e38c5e9041005c9a4a4f -r65558208e4968de9a5470ff5fda1ee2a9d00c793 --- sources/view/settings/VDateTime.cpp (.../VDateTime.cpp) (revision 506a9e3db1a20bda1685e38c5e9041005c9a4a4f) +++ sources/view/settings/VDateTime.cpp (.../VDateTime.cpp) (revision 65558208e4968de9a5470ff5fda1ee2a9d00c793) @@ -66,20 +66,37 @@ const QString &vHour , const QString &vMinute ) { + year ( vYear ); + month ( vMonth ); + day ( vDay ); + hour ( vHour ); + minute ( vMinute ); quint32 epoch = QDateTime( - QDate(vYear .toInt() , - vMonth .toInt() , - vDay .toInt()), - QTime(vHour .toInt() , - vMinute .toInt()) + QDate(_year .toInt() , + _month .toInt() , + _day .toInt()), + QTime(_hour .toInt() , + _minute .toInt()) ).toSecsSinceEpoch(); - status("Setting date and time..."); + // the accepted format of the Linux data command: + // example: 2021-03-16 16:24:00 + QString mDateTime = QString("%1-%2-%3 %4:%5:%6") + .arg(_year ) + .arg(_month ) + .arg(_day ) + .arg(_hour ) + .arg(_minute) + .arg(_second); - dateTimeHD(epoch); - dateTimeDG(epoch); - dateTimeUI( ); + LOG_EVENT(tr("SetDateTime %1").arg(mDateTime)); + + status("Setting date and time ..."); + + dateTimeUI(mDateTime); + dateTimeHD(epoch ); + dateTimeDG(epoch ); } /*! @@ -95,6 +112,7 @@ } else { _acceptUI = SUCCEED; + LOG_EVENT("SetDateTime Succeed"); } updateStatus(); } @@ -153,18 +171,9 @@ * \brief VDateTime::dateTimeUI * \details starts the shell script in a process defined in Storage::Date_Time_Set_Sh to update the device date/time */ -void VDateTime::dateTimeUI() +void VDateTime::dateTimeUI(const QString &vDateTime) { - // the accepted format of the Linux data command: - // example: 2021-03-16 16:24:00 - QString setTime = QString("%1-%2-%3 %4:%5:%6") - .arg(_year ) - .arg(_month ) - .arg(_day ) - .arg(_hour ) - .arg(_minute) - .arg(_second); - _process.start(Storage::Date_Time_Set_Sh, QStringList() << setTime); + _process.start(Storage::Date_Time_Set_Sh, QStringList() << vDateTime); } /*!