mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
refs #602, threadsafe access to central QNetworkAccessManager post/get
* threadsafe (used from workers) * added post methods * renamed functions to better refelct post/get * use central QNetworkAccessManager in readers, removed local readers
This commit is contained in:
committed by
Mathew Sutcliffe
parent
65af7d87da
commit
8a7eba74d9
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "databasewriter.h"
|
||||
#include "blackcore/cookiemanager.h"
|
||||
#include "blackcore/application.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/datastoreutility.h"
|
||||
#include "blackmisc/network/networkutils.h"
|
||||
@@ -28,9 +28,7 @@ namespace BlackCore
|
||||
QObject(parent),
|
||||
m_modelPublishUrl(getModelPublishUrl(baseUrl))
|
||||
{
|
||||
this->m_networkManager = new QNetworkAccessManager(this);
|
||||
CCookieManager::setToAccessManager(this->m_networkManager);
|
||||
this->connect(this->m_networkManager, &QNetworkAccessManager::finished, this, &CDatabaseWriter::ps_postResponse);
|
||||
// void
|
||||
}
|
||||
|
||||
CStatusMessageList CDatabaseWriter::asyncPublishModels(const CAircraftModelList &models)
|
||||
@@ -58,7 +56,7 @@ namespace BlackCore
|
||||
multiPart->append(CNetworkUtils::getMultipartWithDebugFlag());
|
||||
}
|
||||
|
||||
m_pendingReply = this->m_networkManager->post(request, multiPart);
|
||||
m_pendingReply = sApp->postToNetwork(request, multiPart, { this, &CDatabaseWriter::ps_postResponse});
|
||||
multiPart->setParent(m_pendingReply);
|
||||
return msgs;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user