mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 08:45:36 +08:00
refs #720, renaming in writer
This commit is contained in:
committed by
Mathew Sutcliffe
parent
6f61d323c2
commit
c5dc61d64f
@@ -65,7 +65,7 @@ namespace BlackCore
|
|||||||
multiPart->append(CNetworkUtils::getMultipartWithDebugFlag());
|
multiPart->append(CNetworkUtils::getMultipartWithDebugFlag());
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pendingReply = sApp->postToNetwork(request, multiPart, { this, &CDatabaseWriter::ps_postResponse});
|
m_pendingReply = sApp->postToNetwork(request, multiPart, { this, &CDatabaseWriter::ps_postModelsResponse});
|
||||||
return msgs;
|
return msgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDatabaseWriter::ps_postResponse(QNetworkReply *nwReplyPtr)
|
void CDatabaseWriter::ps_postModelsResponse(QNetworkReply *nwReplyPtr)
|
||||||
{
|
{
|
||||||
static const CLogCategoryList cats(CLogCategoryList(this).join({ CLogCategory::swiftDbWebservice()}));
|
static const CLogCategoryList cats(CLogCategoryList(this).join({ CLogCategory::swiftDbWebservice()}));
|
||||||
QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> nwReply(nwReplyPtr);
|
QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> nwReply(nwReplyPtr);
|
||||||
@@ -100,7 +100,7 @@ namespace BlackCore
|
|||||||
if (dataFileData.isEmpty())
|
if (dataFileData.isEmpty())
|
||||||
{
|
{
|
||||||
const CStatusMessageList msgs({CStatusMessage(cats, CStatusMessage::SeverityError, "No response data from " + urlString)});
|
const CStatusMessageList msgs({CStatusMessage(cats, CStatusMessage::SeverityError, "No response data from " + urlString)});
|
||||||
emit published(CAircraftModelList(), CAircraftModelList(), msgs);
|
emit publishedModels(CAircraftModelList(), CAircraftModelList(), msgs);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +108,7 @@ namespace BlackCore
|
|||||||
CAircraftModelList modelsSkipped;
|
CAircraftModelList modelsSkipped;
|
||||||
CStatusMessageList msgs;
|
CStatusMessageList msgs;
|
||||||
bool success = CDatastoreUtility::parseSwiftPublishResponse(dataFileData, modelsPublished, modelsSkipped, msgs);
|
bool success = CDatastoreUtility::parseSwiftPublishResponse(dataFileData, modelsPublished, modelsSkipped, msgs);
|
||||||
emit published(modelsPublished, modelsSkipped, msgs);
|
emit publishedModels(modelsPublished, modelsSkipped, msgs);
|
||||||
Q_UNUSED(success);
|
Q_UNUSED(success);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -116,7 +116,7 @@ namespace BlackCore
|
|||||||
QString error = nwReply->errorString();
|
QString error = nwReply->errorString();
|
||||||
nwReply->close(); // close asap
|
nwReply->close(); // close asap
|
||||||
const CStatusMessageList msgs( {CStatusMessage(cats, CStatusMessage::SeverityError, "HTTP error: " + error)});
|
const CStatusMessageList msgs( {CStatusMessage(cats, CStatusMessage::SeverityError, "HTTP error: " + error)});
|
||||||
emit published(CAircraftModelList(), CAircraftModelList(), msgs);
|
emit publishedModels(CAircraftModelList(), CAircraftModelList(), msgs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,11 +44,11 @@ namespace BlackCore
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
//! Published models, the response to \sa asyncPublishModels
|
//! Published models, the response to \sa asyncPublishModels
|
||||||
void published(const BlackMisc::Simulation::CAircraftModelList &modelsPublished, const BlackMisc::Simulation::CAircraftModelList &modelsSkipped, const BlackMisc::CStatusMessageList &messages);
|
void publishedModels(const BlackMisc::Simulation::CAircraftModelList &modelsPublished, const BlackMisc::Simulation::CAircraftModelList &modelsSkipped, const BlackMisc::CStatusMessageList &messages);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
//! Post response
|
//! Post response
|
||||||
void ps_postResponse(QNetworkReply *nwReplyPtr);
|
void ps_postModelsResponse(QNetworkReply *nwReplyPtr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BlackMisc::Network::CUrl m_modelPublishUrl;
|
BlackMisc::Network::CUrl m_modelPublishUrl;
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ namespace BlackGui
|
|||||||
CAircraftModel model(this->ui->tvp_AircraftModel->container().latestObject());
|
CAircraftModel model(this->ui->tvp_AircraftModel->container().latestObject());
|
||||||
ts = model.getUtcTimestamp();
|
ts = model.getUtcTimestamp();
|
||||||
}
|
}
|
||||||
sGui->getWebDataServices()->triggerRead(CEntityFlags::ModelEntity, ts);
|
sGui->getWebDataServices()->triggerReloadFromDb(CEntityFlags::ModelEntity, ts);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbModelComponent::ps_modelsRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count)
|
void CDbModelComponent::ps_modelsRead(CEntityFlags::Entity entity, CEntityFlags::ReadState readState, int count)
|
||||||
@@ -91,7 +91,7 @@ namespace BlackGui
|
|||||||
void CDbModelComponent::ps_reload()
|
void CDbModelComponent::ps_reload()
|
||||||
{
|
{
|
||||||
if (!sGui) { return; }
|
if (!sGui) { return; }
|
||||||
sGui->getWebDataServices()->triggerRead(CEntityFlags::ModelEntity);
|
sGui->getWebDataServices()->triggerReloadFromDb(CEntityFlags::ModelEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDbModelComponent::ps_onStyleSheetChanged()
|
void CDbModelComponent::ps_onStyleSheetChanged()
|
||||||
|
|||||||
Reference in New Issue
Block a user