refs #751, improved model writing to DB

* a pending request can be aborted when taking too long
* success / directWrite flags in signals
This commit is contained in:
Klaus Basan
2016-09-01 01:01:25 +02:00
committed by Roland Winklmeier
parent ced9f5294e
commit 23ccb35ed8
8 changed files with 75 additions and 27 deletions

View File

@@ -44,7 +44,10 @@ namespace BlackCore
signals:
//! Published models, the response to \sa asyncPublishModels
void publishedModels(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,
bool success, bool directWrite);
private slots:
//! Post response
@@ -53,8 +56,15 @@ namespace BlackCore
private:
BlackMisc::Network::CUrl m_modelPublishUrl;
QNetworkReply *m_pendingReply = nullptr;
qint64 m_replyPendingSince = -1;
bool m_shutdown = false;
//! Kill the pending reply
bool killPendingReply();
//! Reply timed out?
bool isReplyOverdue() const;
//! URL model web service
static BlackMisc::Network::CUrl getModelPublishUrl(const BlackMisc::Network::CUrl &baseUrl);