mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-03 07:35:53 +08:00
Ref T554, style
This commit is contained in:
committed by
Mat Sutcliffe
parent
349a40723e
commit
8569713331
@@ -74,7 +74,7 @@ namespace BlackCore
|
|||||||
BlackMisc::Network::CUrl m_autoPublishUrl; //!< auto publish data
|
BlackMisc::Network::CUrl m_autoPublishUrl; //!< auto publish data
|
||||||
QNetworkReply *m_pendingModelPublishReply = nullptr;
|
QNetworkReply *m_pendingModelPublishReply = nullptr;
|
||||||
QNetworkReply *m_pendingAutoPublishReply = nullptr;
|
QNetworkReply *m_pendingAutoPublishReply = nullptr;
|
||||||
qint64 m_modelReplyPendingSince = -1;
|
qint64 m_modelReplyPendingSince = -1;
|
||||||
qint64 m_autoPublishReplyPendingSince = -1;
|
qint64 m_autoPublishReplyPendingSince = -1;
|
||||||
bool m_shutdown = false;
|
bool m_shutdown = false;
|
||||||
|
|
||||||
|
|||||||
@@ -33,14 +33,14 @@ namespace BlackGui
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
connect(ui->cb_EnableServerDebugging, &QCheckBox::toggled, this, &CDbDebugDatabaseSetup::ps_debugChanged);
|
connect(ui->cb_EnableServerDebugging, &QCheckBox::toggled, this, &CDbDebugDatabaseSetup::onDebugChanged);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CDbDebugDatabaseSetup::~CDbDebugDatabaseSetup()
|
CDbDebugDatabaseSetup::~CDbDebugDatabaseSetup()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
void CDbDebugDatabaseSetup::ps_debugChanged(bool set)
|
void CDbDebugDatabaseSetup::onDebugChanged(bool set)
|
||||||
{
|
{
|
||||||
CGlobalSetup gs(m_setup.getThreadLocal());
|
CGlobalSetup gs(m_setup.getThreadLocal());
|
||||||
gs.setServerDebugFlag(set);
|
gs.setServerDebugFlag(set);
|
||||||
|
|||||||
@@ -19,10 +19,7 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
|
|
||||||
class QWidget;
|
|
||||||
|
|
||||||
namespace Ui { class CDbDebugDatabaseSetup; }
|
namespace Ui { class CDbDebugDatabaseSetup; }
|
||||||
|
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
{
|
{
|
||||||
namespace Components
|
namespace Components
|
||||||
@@ -42,11 +39,10 @@ namespace BlackGui
|
|||||||
//! Dstructor
|
//! Dstructor
|
||||||
~CDbDebugDatabaseSetup();
|
~CDbDebugDatabaseSetup();
|
||||||
|
|
||||||
private slots:
|
|
||||||
//! Changed the debug checkbox
|
|
||||||
void ps_debugChanged(bool set);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
//! Changed the debug checkbox
|
||||||
|
void onDebugChanged(bool set);
|
||||||
|
|
||||||
QScopedPointer<Ui::CDbDebugDatabaseSetup> ui;
|
QScopedPointer<Ui::CDbDebugDatabaseSetup> ui;
|
||||||
BlackMisc::CData<BlackCore::Data::TGlobalSetup> m_setup {this}; //!< data cache
|
BlackMisc::CData<BlackCore::Data::TGlobalSetup> m_setup {this}; //!< data cache
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
namespace Ui { class CLoginComponent; }
|
||||||
namespace BlackMisc
|
namespace BlackMisc
|
||||||
{
|
{
|
||||||
namespace Simulation
|
namespace Simulation
|
||||||
@@ -42,7 +43,6 @@ namespace BlackMisc
|
|||||||
class CSimulatedAircraft;
|
class CSimulatedAircraft;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
namespace Ui { class CLoginComponent; }
|
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
{
|
{
|
||||||
namespace Components
|
namespace Components
|
||||||
|
|||||||
@@ -29,6 +29,12 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
namespace Db
|
namespace Db
|
||||||
{
|
{
|
||||||
|
const CLogCategoryList &CDatastoreUtility::getLogCategories()
|
||||||
|
{
|
||||||
|
static const CLogCategoryList cats({CLogCategory::swiftDbWebservice()});
|
||||||
|
return cats;
|
||||||
|
}
|
||||||
|
|
||||||
bool CDatastoreUtility::dbBoolStringToBool(const QString &dbBool)
|
bool CDatastoreUtility::dbBoolStringToBool(const QString &dbBool)
|
||||||
{
|
{
|
||||||
return BlackMisc::stringToBool(dbBool);
|
return BlackMisc::stringToBool(dbBool);
|
||||||
@@ -76,16 +82,15 @@ namespace BlackMisc
|
|||||||
|
|
||||||
bool CDatastoreUtility::parseSwiftPublishResponse(const QString &jsonResponse, CAircraftModelList &publishedModels, CAircraftModelList &skippedModels, CStatusMessageList &messages, bool &directWrite)
|
bool CDatastoreUtility::parseSwiftPublishResponse(const QString &jsonResponse, CAircraftModelList &publishedModels, CAircraftModelList &skippedModels, CStatusMessageList &messages, bool &directWrite)
|
||||||
{
|
{
|
||||||
static const CLogCategoryList cats({CLogCategory::swiftDbWebservice()});
|
|
||||||
directWrite = false;
|
directWrite = false;
|
||||||
|
|
||||||
if (jsonResponse.isEmpty())
|
if (jsonResponse.isEmpty())
|
||||||
{
|
{
|
||||||
messages.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, u"Empty JSON data for published models"));
|
messages.push_back(CStatusMessage(getLogCategories(), CStatusMessage::SeverityError, u"Empty JSON data for published models"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonDocument jsonDoc(QJsonDocument::fromJson(jsonResponse.toUtf8()));
|
const QJsonDocument jsonDoc(QJsonDocument::fromJson(jsonResponse.toUtf8()));
|
||||||
|
|
||||||
// array of messages only
|
// array of messages only
|
||||||
if (jsonDoc.isArray())
|
if (jsonDoc.isArray())
|
||||||
@@ -99,7 +104,7 @@ namespace BlackMisc
|
|||||||
if (!jsonDoc.isObject())
|
if (!jsonDoc.isObject())
|
||||||
{
|
{
|
||||||
const QString phpError(CNetworkUtils::removeHtmlPartsFromPhpErrorMessage(jsonResponse));
|
const QString phpError(CNetworkUtils::removeHtmlPartsFromPhpErrorMessage(jsonResponse));
|
||||||
messages.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, phpError));
|
messages.push_back(CStatusMessage(getLogCategories(), CStatusMessage::SeverityError, phpError));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,7 +153,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
if (!hasData)
|
if (!hasData)
|
||||||
{
|
{
|
||||||
messages.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, u"Received response, but no JSON data"));
|
messages.push_back(CStatusMessage(getLogCategories(), CStatusMessage::SeverityError, u"Received response, but no JSON data"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return hasData;
|
return hasData;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#ifndef BLACKMISC_DB_DATASTOREUTILITY_H
|
#ifndef BLACKMISC_DB_DATASTOREUTILITY_H
|
||||||
#define BLACKMISC_DB_DATASTOREUTILITY_H
|
#define BLACKMISC_DB_DATASTOREUTILITY_H
|
||||||
|
|
||||||
|
#include "blackmisc/logcategorylist.h"
|
||||||
#include "blackmisc/blackmiscexport.h"
|
#include "blackmisc/blackmiscexport.h"
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
@@ -29,6 +30,9 @@ namespace BlackMisc
|
|||||||
class BLACKMISC_EXPORT CDatastoreUtility
|
class BLACKMISC_EXPORT CDatastoreUtility
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
//! Log.categories
|
||||||
|
static const CLogCategoryList &getLogCategories();
|
||||||
|
|
||||||
//! No constructor
|
//! No constructor
|
||||||
CDatastoreUtility() = delete;
|
CDatastoreUtility() = delete;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user