Fix conflict with macros on Windows.

This commit is contained in:
Roman Telezhynskyi 2024-04-16 11:46:02 +03:00
parent cd7bf7d261
commit 5b92408fee
3 changed files with 9 additions and 10 deletions

View File

@ -298,8 +298,7 @@ void VGAnalytics::SendAppCloseEvent(qint64 engagementTimeMsec)
};
SendEvent(QStringLiteral("vapp_close"), params);
QNetworkReply *reply = d->PostMessage();
if (reply)
if (QNetworkReply *reply = d->SendAnalytics())
{
QTimer timer;
const int timeoutSeconds = 3; // Wait for 3 seconds

View File

@ -78,7 +78,7 @@ VGAnalyticsWorker::VGAnalyticsWorker(QObject *parent)
m_screenScaleFactor = screen->logicalDotsPerInchX() / 96.0;
m_timer.setInterval(m_timerInterval);
connect(&m_timer, &QTimer::timeout, this, &VGAnalyticsWorker::PostMessage);
connect(&m_timer, &QTimer::timeout, this, &VGAnalyticsWorker::SendAnalytics);
}
//---------------------------------------------------------------------------------------------------------------------
@ -203,7 +203,7 @@ void VGAnalyticsWorker::EnqueQueryWithCurrentTime(const QJsonObject &query)
* The message POST is asyncroniously when the server
* answered a signal will be emitted.
*/
auto VGAnalyticsWorker::PostMessage() -> QNetworkReply *
auto VGAnalyticsWorker::SendAnalytics() -> QNetworkReply *
{
if (m_messageQueue.isEmpty())
{
@ -229,7 +229,7 @@ auto VGAnalyticsWorker::PostMessage() -> QNetworkReply *
{
// too old.
m_messageQueue.dequeue();
return PostMessage();
return SendAnalytics();
}
QByteArray const requestJson = QJsonDocument(buffer.postQuery).toJson(QJsonDocument::Compact);
@ -258,7 +258,7 @@ auto VGAnalyticsWorker::PostMessage() -> QNetworkReply *
}
QNetworkReply *reply = networkManager->post(m_request, requestJson);
connect(reply, &QNetworkReply::finished, this, &VGAnalyticsWorker::PostMessageFinished);
connect(reply, &QNetworkReply::finished, this, &VGAnalyticsWorker::SendAnalyticsFinished);
return reply;
}
@ -272,7 +272,7 @@ auto VGAnalyticsWorker::PostMessage() -> QNetworkReply *
* If message couldn't be send then next try is when the
* timer emits its signal.
*/
void VGAnalyticsWorker::PostMessageFinished()
void VGAnalyticsWorker::SendAnalyticsFinished()
{
auto *reply = qobject_cast<QNetworkReply *>(sender());
@ -289,6 +289,6 @@ void VGAnalyticsWorker::PostMessageFinished()
LogMessage(VGAnalytics::Debug, QStringLiteral("Message sent"));
m_messageQueue.dequeue();
PostMessage();
SendAnalytics();
reply->deleteLater();
}

View File

@ -91,8 +91,8 @@ public:
void Enable(bool state);
public slots:
QNetworkReply *PostMessage(); // NOLINT(modernize-use-trailing-return-type)
void PostMessageFinished();
QNetworkReply *SendAnalytics(); // NOLINT(modernize-use-trailing-return-type)
void SendAnalyticsFinished();
private:
Q_DISABLE_COPY_MOVE(VGAnalyticsWorker) // NOLINT