From 31742156fd22ff878d765a0c4f9267136610279f Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Fri, 7 Aug 2020 22:53:21 +0100 Subject: [PATCH] Qt v5.8 backwards compatibility --- Network/PSKReporter.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Network/PSKReporter.cpp b/Network/PSKReporter.cpp index 5a367e58f..59408c284 100644 --- a/Network/PSKReporter.cpp +++ b/Network/PSKReporter.cpp @@ -402,7 +402,13 @@ void PSKReporter::impl::send_report (bool send_residue) writeUtfString (tx_out, spot.grid_); tx_out << quint8 (1u) // REPORTER_SOURCE_AUTOMATIC - << static_cast (spot.time_.toSecsSinceEpoch ()); + << static_cast ( +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) + spot.time_.toSecsSinceEpoch () +#else + spot.time_.toMSecsSinceEpoch () / 1000 +#endif + ); } auto len = payload_.size () + tx_data_.size (); @@ -429,7 +435,13 @@ void PSKReporter::impl::send_report (bool send_residue) // insert Length and Export Time set_length (message, payload_); message.device ()->seek (2 * sizeof (quint16)); - message << static_cast (QDateTime::currentDateTime ().toSecsSinceEpoch ()); + message << static_cast ( +#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0) + QDateTime::currentDateTime ().toSecsSinceEpoch () +#else + QDateTime::currentDateTime ().toMSecsSinceEpoch () / 1000 +#endif + ); // Send data to PSK Reporter site socket_->write (payload_); // TODO: handle errors