Qt v5.8 backwards compatibility

This commit is contained in:
Bill Somerville 2020-08-07 22:53:21 +01:00
parent 7bafb5b71e
commit 31742156fd
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F

View File

@ -402,7 +402,13 @@ void PSKReporter::impl::send_report (bool send_residue)
writeUtfString (tx_out, spot.grid_); writeUtfString (tx_out, spot.grid_);
tx_out tx_out
<< quint8 (1u) // REPORTER_SOURCE_AUTOMATIC << quint8 (1u) // REPORTER_SOURCE_AUTOMATIC
<< static_cast<quint32> (spot.time_.toSecsSinceEpoch ()); << static_cast<quint32> (
#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 (); auto len = payload_.size () + tx_data_.size ();
@ -429,7 +435,13 @@ void PSKReporter::impl::send_report (bool send_residue)
// insert Length and Export Time // insert Length and Export Time
set_length (message, payload_); set_length (message, payload_);
message.device ()->seek (2 * sizeof (quint16)); message.device ()->seek (2 * sizeof (quint16));
message << static_cast<quint32> (QDateTime::currentDateTime ().toSecsSinceEpoch ()); message << static_cast<quint32> (
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
QDateTime::currentDateTime ().toSecsSinceEpoch ()
#else
QDateTime::currentDateTime ().toMSecsSinceEpoch () / 1000
#endif
);
// Send data to PSK Reporter site // Send data to PSK Reporter site
socket_->write (payload_); // TODO: handle errors socket_->write (payload_); // TODO: handle errors