mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +08:00
refs #485, further removed global setup traits from classes with read only
Use global setup from sGui/sApp
This commit is contained in:
committed by
Mathew Sutcliffe
parent
30b5e5dade
commit
aa96731143
@@ -51,7 +51,7 @@ namespace BlackCore
|
||||
if (pw.isEmpty()) { msgs.push_back(CStatusMessage(cats, CStatusMessage::SeverityError, "No password")); }
|
||||
if (!msgs.isEmpty()) { return msgs; }
|
||||
|
||||
CUrl url(this->m_setup.get().dbLoginServiceUrl());
|
||||
const CUrl url(sApp->getGlobalSetup().dbLoginServiceUrl());
|
||||
QString msg;
|
||||
if (!CNetworkUtils::canConnect(url, msg))
|
||||
{
|
||||
@@ -62,7 +62,7 @@ namespace BlackCore
|
||||
QUrlQuery params;
|
||||
params.addQueryItem("username", un);
|
||||
params.addQueryItem("password", pw);
|
||||
if (m_setup.get().dbDebugFlag()) { CNetworkUtils::addDebugFlag(params); }
|
||||
if (sApp->getGlobalSetup().dbDebugFlag()) { CNetworkUtils::addDebugFlag(params); }
|
||||
|
||||
QString query = params.toString();
|
||||
const QNetworkRequest request(CNetworkUtils::getNetworkRequest(url, CNetworkUtils::PostUrlEncoded));
|
||||
@@ -74,7 +74,7 @@ namespace BlackCore
|
||||
|
||||
void CDatabaseAuthenticationService::logoff()
|
||||
{
|
||||
CUrl url(this->m_setup.get().dbLoginServiceUrl());
|
||||
CUrl url(sApp->getGlobalSetup().dbLoginServiceUrl());
|
||||
url.setQuery("logoff=true");
|
||||
QNetworkRequest request(CNetworkUtils::getNetworkRequest(url));
|
||||
sApp->getFromNetwork(request, { this, &CDatabaseAuthenticationService::ps_parseServerResponse });
|
||||
|
||||
@@ -59,7 +59,6 @@ namespace BlackCore
|
||||
void ps_userChanged();
|
||||
|
||||
private:
|
||||
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< data cache
|
||||
BlackMisc::CData<BlackCore::Data::AuthenticatedDbUser> m_swiftDbUser {this, &CDatabaseAuthenticationService::ps_userChanged};
|
||||
bool m_shutdown = false;
|
||||
};
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace BlackCore
|
||||
CNetworkUtils::ignoreSslVerification(request);
|
||||
QHttpMultiPart *multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType, this);
|
||||
multiPart->append(CNetworkUtils::getJsonTextMultipart(models.toDatabaseJson()));
|
||||
if (m_setup.get().dbDebugFlag())
|
||||
if (sApp->getGlobalSetup().dbDebugFlag())
|
||||
{
|
||||
multiPart->append(CNetworkUtils::getMultipartWithDebugFlag());
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@ namespace BlackCore
|
||||
void ps_postResponse(QNetworkReply *nwReplyPtr);
|
||||
|
||||
private:
|
||||
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< data cache
|
||||
BlackMisc::Network::CUrl m_modelPublishUrl;
|
||||
QNetworkReply *m_pendingReply = nullptr;
|
||||
bool m_shutdown = false;
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace BlackCore
|
||||
{
|
||||
this->threadAssertCheck();
|
||||
Q_ASSERT_X(sApp, Q_FUNC_INFO, "No application");
|
||||
QUrl url(m_setup.get().vatsimBookingsUrl());
|
||||
const QUrl url(sApp->getGlobalSetup().vatsimBookingsUrl());
|
||||
if (url.isEmpty()) { return; }
|
||||
|
||||
sApp->getFromNetwork(url, { this, &CVatsimBookingReader::ps_parseBookings});
|
||||
|
||||
@@ -54,9 +54,6 @@ namespace BlackCore
|
||||
|
||||
//! Do reading
|
||||
void ps_read();
|
||||
|
||||
private:
|
||||
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -158,9 +158,9 @@ namespace BlackCore
|
||||
// round robin for load balancing
|
||||
// remark: Don't use QThread to run network operations in the background
|
||||
// see http://qt-project.org/doc/qt-4.7/qnetworkaccessmanager.html
|
||||
QUrl url(m_setup.get().vatsimDataFileUrls().getRandomUrl());
|
||||
if (url.isEmpty()) { return; }
|
||||
Q_ASSERT_X(sApp, Q_FUNC_INFO, "Missing application");
|
||||
const QUrl url(sApp->getGlobalSetup().vatsimDataFileUrls().getRandomUrl());
|
||||
if (url.isEmpty()) { return; }
|
||||
sApp->getFromNetwork(url, { this, &CVatsimDataFileReader::ps_parseVatsimFile});
|
||||
|
||||
}
|
||||
|
||||
@@ -128,7 +128,6 @@ namespace BlackCore
|
||||
BlackMisc::Aviation::CAtcStationList m_atcStations;
|
||||
BlackMisc::Simulation::CSimulatedAircraftList m_aircraft;
|
||||
QMap<BlackMisc::Aviation::CCallsign, BlackMisc::Network::CVoiceCapabilities> m_voiceCapabilities;
|
||||
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
|
||||
|
||||
//! Split line and assign values to their corresponding attribute names
|
||||
static const QMap<QString, QString> clientPartsToMap(const QString ¤tLine, const QStringList &clientSectionAttributes);
|
||||
|
||||
@@ -466,7 +466,7 @@ namespace BlackCore
|
||||
void CWebDataServices::initWriters()
|
||||
{
|
||||
this->m_databaseWriter = new CDatabaseWriter(
|
||||
m_setup.get().dbRootDirectoryUrl(),
|
||||
sApp->getGlobalSetup().dbRootDirectoryUrl(),
|
||||
this);
|
||||
}
|
||||
|
||||
|
||||
@@ -281,7 +281,6 @@ namespace BlackCore
|
||||
CWebReaderFlags::WebReader m_readerFlags = CWebReaderFlags::WebReaderFlag::None; //!< which readers are available
|
||||
CWebReaderFlags::DbReaderHint m_dbHint = CWebReaderFlags::NoHint; //!< how to read DB data
|
||||
bool m_initialRead = false; //!< Initial read conducted
|
||||
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this, &CWebDataServices::ps_setupChanged}; //!< setup cache
|
||||
|
||||
// for reading XML and VATSIM data files
|
||||
CVatsimBookingReader *m_vatsimBookingReader = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user