[AFV] First version of threaded CAfvClient

This commit is contained in:
Roland Rossgotterer
2019-10-05 20:51:24 +02:00
committed by Mat Sutcliffe
parent d1006160f8
commit d3a1eb1d60
10 changed files with 238 additions and 59 deletions

View File

@@ -63,7 +63,7 @@ namespace BlackCore
QNetworkRequest request(url);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
QEventLoop loop(sApp);
QEventLoop loop;
// posted in QAM thread, reply is nullptr if called from another thread
QNetworkReply *reply = sApp->postToNetwork(request, CApplication::NoLogRequestId, QJsonDocument(obj).toJson(),
@@ -160,7 +160,7 @@ namespace BlackCore
{
if (isShuttingDown()) { return {}; }
QEventLoop loop(sApp);
QEventLoop loop;
QByteArray receivedData;
// posted in QAM thread, reply is nullptr if called from another thread
@@ -196,7 +196,7 @@ namespace BlackCore
{
if (isShuttingDown()) { return {}; }
QEventLoop loop(sApp);
QEventLoop loop;
QByteArray receivedData;
// posted in QAM thread, reply is nullptr if called from another thread

View File

@@ -14,6 +14,7 @@
#include "blackmisc/logcategorylist.h"
#include "blackcore/afv/dto.h"
#include "blackcore/application.h"
#include "blackmisc/logmessage.h"
#include <QString>
#include <QNetworkAccessManager>
@@ -78,7 +79,7 @@ namespace BlackCore
{
if (!m_isAuthenticated)
{
CLogMessage(this).debug(u"AFV not authenticated");
BlackMisc::CLogMessage(this).debug(u"AFV not authenticated");
return {};
}
@@ -101,7 +102,7 @@ namespace BlackCore
{
if (! m_isAuthenticated)
{
CLogMessage(this).debug(u"AFV not authenticated");
BlackMisc::CLogMessage(this).debug(u"AFV not authenticated");
return {};
}