mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Added CDatabaseWriter::getLogCategories.
This commit is contained in:
@@ -146,9 +146,17 @@ namespace BlackCore
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const CLogCategoryList &CDatabaseWriter::getLogCategories()
|
||||||
|
{
|
||||||
|
static const CLogCategoryList cats
|
||||||
|
{
|
||||||
|
CLogCategory::swiftDbWebservice(), CLogCategory::webservice()
|
||||||
|
};
|
||||||
|
return cats;
|
||||||
|
}
|
||||||
|
|
||||||
void CDatabaseWriter::postedModelsResponse(QNetworkReply *nwReplyPtr)
|
void CDatabaseWriter::postedModelsResponse(QNetworkReply *nwReplyPtr)
|
||||||
{
|
{
|
||||||
static const CLogCategoryList cats(CLogCategoryList(this).join({ CLogCategory::swiftDbWebservice()}));
|
|
||||||
QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> nwReply(nwReplyPtr);
|
QScopedPointer<QNetworkReply, QScopedPointerDeleteLater> nwReply(nwReplyPtr);
|
||||||
if (m_shutdown || !sApp)
|
if (m_shutdown || !sApp)
|
||||||
{
|
{
|
||||||
@@ -165,7 +173,7 @@ namespace BlackCore
|
|||||||
nwReply->close(); // close asap
|
nwReply->close(); // close asap
|
||||||
if (responseData.isEmpty())
|
if (responseData.isEmpty())
|
||||||
{
|
{
|
||||||
const CStatusMessageList msgs({CStatusMessage(cats, CStatusMessage::SeverityError, u"No response data from " % urlString)});
|
const CStatusMessageList msgs({CStatusMessage(this, CStatusMessage::SeverityError, u"No response data from " % urlString)});
|
||||||
emit this->publishedModels(CAircraftModelList(), CAircraftModelList(), msgs, false, false);
|
emit this->publishedModels(CAircraftModelList(), CAircraftModelList(), msgs, false, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -189,7 +197,7 @@ namespace BlackCore
|
|||||||
{
|
{
|
||||||
const QString error = nwReply->errorString();
|
const QString error = nwReply->errorString();
|
||||||
nwReply->close(); // close asap
|
nwReply->close(); // close asap
|
||||||
const CStatusMessageList msgs({CStatusMessage(cats, CStatusMessage::SeverityError, u"HTTP error: " % error)});
|
const CStatusMessageList msgs({CStatusMessage(this, CStatusMessage::SeverityError, u"HTTP error: " % error)});
|
||||||
emit this->publishedModels(CAircraftModelList(), CAircraftModelList(), msgs, false, false);
|
emit this->publishedModels(CAircraftModelList(), CAircraftModelList(), msgs, false, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,9 @@ namespace BlackCore
|
|||||||
//! Write log
|
//! Write log
|
||||||
const BlackMisc::Network::CUrlLogList &getWriteLog() const { return m_writeLog; }
|
const BlackMisc::Network::CUrlLogList &getWriteLog() const { return m_writeLog; }
|
||||||
|
|
||||||
|
//! Log categories
|
||||||
|
static const BlackMisc::CLogCategoryList &getLogCategories();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
//! Published models, the response to \sa asyncPublishModels
|
//! Published models, the response to \sa asyncPublishModels
|
||||||
void publishedModels(const BlackMisc::Simulation::CAircraftModelList &modelsPublished,
|
void publishedModels(const BlackMisc::Simulation::CAircraftModelList &modelsPublished,
|
||||||
|
|||||||
Reference in New Issue
Block a user