mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +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
|
||||
QNetworkReply *m_pendingModelPublishReply = nullptr;
|
||||
QNetworkReply *m_pendingAutoPublishReply = nullptr;
|
||||
qint64 m_modelReplyPendingSince = -1;
|
||||
qint64 m_modelReplyPendingSince = -1;
|
||||
qint64 m_autoPublishReplyPendingSince = -1;
|
||||
bool m_shutdown = false;
|
||||
|
||||
|
||||
@@ -33,14 +33,14 @@ namespace BlackGui
|
||||
}
|
||||
else
|
||||
{
|
||||
connect(ui->cb_EnableServerDebugging, &QCheckBox::toggled, this, &CDbDebugDatabaseSetup::ps_debugChanged);
|
||||
connect(ui->cb_EnableServerDebugging, &QCheckBox::toggled, this, &CDbDebugDatabaseSetup::onDebugChanged);
|
||||
}
|
||||
}
|
||||
|
||||
CDbDebugDatabaseSetup::~CDbDebugDatabaseSetup()
|
||||
{ }
|
||||
|
||||
void CDbDebugDatabaseSetup::ps_debugChanged(bool set)
|
||||
void CDbDebugDatabaseSetup::onDebugChanged(bool set)
|
||||
{
|
||||
CGlobalSetup gs(m_setup.getThreadLocal());
|
||||
gs.setServerDebugFlag(set);
|
||||
|
||||
@@ -19,10 +19,7 @@
|
||||
#include <QObject>
|
||||
#include <QScopedPointer>
|
||||
|
||||
class QWidget;
|
||||
|
||||
namespace Ui { class CDbDebugDatabaseSetup; }
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
@@ -42,11 +39,10 @@ namespace BlackGui
|
||||
//! Dstructor
|
||||
~CDbDebugDatabaseSetup();
|
||||
|
||||
private slots:
|
||||
//! Changed the debug checkbox
|
||||
void ps_debugChanged(bool set);
|
||||
|
||||
private:
|
||||
//! Changed the debug checkbox
|
||||
void onDebugChanged(bool set);
|
||||
|
||||
QScopedPointer<Ui::CDbDebugDatabaseSetup> ui;
|
||||
BlackMisc::CData<BlackCore::Data::TGlobalSetup> m_setup {this}; //!< data cache
|
||||
};
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <QScopedPointer>
|
||||
#include <QString>
|
||||
|
||||
namespace Ui { class CLoginComponent; }
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
@@ -42,7 +43,6 @@ namespace BlackMisc
|
||||
class CSimulatedAircraft;
|
||||
}
|
||||
}
|
||||
namespace Ui { class CLoginComponent; }
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
|
||||
@@ -29,6 +29,12 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Db
|
||||
{
|
||||
const CLogCategoryList &CDatastoreUtility::getLogCategories()
|
||||
{
|
||||
static const CLogCategoryList cats({CLogCategory::swiftDbWebservice()});
|
||||
return cats;
|
||||
}
|
||||
|
||||
bool CDatastoreUtility::dbBoolStringToBool(const QString &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)
|
||||
{
|
||||
static const CLogCategoryList cats({CLogCategory::swiftDbWebservice()});
|
||||
directWrite = false;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
QJsonDocument jsonDoc(QJsonDocument::fromJson(jsonResponse.toUtf8()));
|
||||
const QJsonDocument jsonDoc(QJsonDocument::fromJson(jsonResponse.toUtf8()));
|
||||
|
||||
// array of messages only
|
||||
if (jsonDoc.isArray())
|
||||
@@ -99,7 +104,7 @@ namespace BlackMisc
|
||||
if (!jsonDoc.isObject())
|
||||
{
|
||||
const QString phpError(CNetworkUtils::removeHtmlPartsFromPhpErrorMessage(jsonResponse));
|
||||
messages.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, phpError));
|
||||
messages.push_back(CStatusMessage(getLogCategories(), CStatusMessage::SeverityError, phpError));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -148,7 +153,7 @@ namespace BlackMisc
|
||||
|
||||
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;
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#ifndef BLACKMISC_DB_DATASTOREUTILITY_H
|
||||
#define BLACKMISC_DB_DATASTOREUTILITY_H
|
||||
|
||||
#include "blackmisc/logcategorylist.h"
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
|
||||
#include <QDateTime>
|
||||
@@ -29,6 +30,9 @@ namespace BlackMisc
|
||||
class BLACKMISC_EXPORT CDatastoreUtility
|
||||
{
|
||||
public:
|
||||
//! Log.categories
|
||||
static const CLogCategoryList &getLogCategories();
|
||||
|
||||
//! No constructor
|
||||
CDatastoreUtility() = delete;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user