mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 13:36:48 +08:00
refs #559, adjustments cache/settings moved
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
#include "blackcore/contextapplicationproxy.h"
|
||||
#include "blackcore/contextapplicationempty.h"
|
||||
#include "blackcore/inputmanager.h"
|
||||
#include "blackcore/settingscache.h"
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
#include "blackmisc/loghandler.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "contextapplicationimpl.h"
|
||||
#include "contextruntime.h"
|
||||
#include "inputmanager.h"
|
||||
#include "settingscache.h"
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/loghandler.h"
|
||||
#include <QtMsgHandler>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include "blackcore/contextapplicationproxy.h"
|
||||
#include "blackcore/inputmanager.h"
|
||||
#include "blackcore/settingscache.h"
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/blackmiscfreefunctions.h"
|
||||
#include "blackmisc/loghandler.h"
|
||||
#include "blackmisc/identifierlist.h"
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace BlackCore
|
||||
QHash<BlackMisc::Aviation::CComSystem::ComUnit, QSharedPointer<IVoiceChannel>> m_voiceChannelMapping;
|
||||
|
||||
// settings
|
||||
CSetting<BlackCore::Settings::Audio::AudioSettings> m_audioSettings { this };
|
||||
BlackMisc::CSetting<BlackCore::Settings::Audio::AudioSettings> m_audioSettings { this };
|
||||
};
|
||||
} // namespace
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace BlackCore
|
||||
QString m_voiceRoom2UrlOverride; //!< overridden voice room url
|
||||
mutable QReadWriteLock m_lockAircraft; //!< lock aircraft
|
||||
|
||||
CSetting<Settings::Network::CurrentTrafficServer> m_currentNetworkServer { this };
|
||||
BlackMisc::CSetting<Settings::Network::CurrentTrafficServer> m_currentNetworkServer { this };
|
||||
|
||||
//! Init my very own aircraft with some defaults, before overridden by simulator
|
||||
void initOwnAircraft();
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace BlackCore
|
||||
|
||||
private:
|
||||
bool m_init = false; //!< flag
|
||||
CSetting<Settings::Network::DBusServerAddress> m_dbusServerAddress { this };
|
||||
BlackMisc::CSetting<Settings::Network::DBusServerAddress> m_dbusServerAddress { this };
|
||||
|
||||
// DBus
|
||||
BlackMisc::CDBusServer *m_dbusServer = nullptr;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#define BLACKCORE_DATA_AIRCRAFTMODELS_H
|
||||
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackcore/datacache.h"
|
||||
#include "blackmisc/datacache.h"
|
||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||
#include "blackmisc/variant.h"
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace BlackCore
|
||||
namespace Data
|
||||
{
|
||||
//! Trait for own simulator models
|
||||
struct OwnSimulatorAircraftModels : public BlackCore::CDataTrait<BlackMisc::Simulation::CAircraftModelList>
|
||||
struct OwnSimulatorAircraftModels : public BlackMisc::CDataTrait<BlackMisc::Simulation::CAircraftModelList>
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "simulator/models"; }
|
||||
@@ -36,7 +36,7 @@ namespace BlackCore
|
||||
};
|
||||
|
||||
//! Trait for vPilot derived models
|
||||
struct VPilotAircraftModels : public BlackCore::CDataTrait<BlackMisc::Simulation::CAircraftModelList>
|
||||
struct VPilotAircraftModels : public BlackMisc::CDataTrait<BlackMisc::Simulation::CAircraftModelList>
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "vpilot/models"; }
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#define BLACKCORE_DATA_AUTHENTICATEDUSER_H
|
||||
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackcore/datacache.h"
|
||||
#include "blackmisc/datacache.h"
|
||||
#include "blackmisc/network/authenticateduser.h"
|
||||
|
||||
namespace BlackCore
|
||||
@@ -21,7 +21,7 @@ namespace BlackCore
|
||||
namespace Data
|
||||
{
|
||||
//! Trait for for global setup data
|
||||
struct AuthenticatedUser : public BlackCore::CDataTrait<BlackMisc::Network::CAuthenticatedUser>
|
||||
struct AuthenticatedUser : public BlackMisc::CDataTrait<BlackMisc::Network::CAuthenticatedUser>
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "readers/global/user"; }
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#define BLACKCORE_DATA_GLOBALSETUP_H
|
||||
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackcore/datacache.h"
|
||||
#include "blackmisc/datacache.h"
|
||||
#include "blackmisc/network/serverlist.h"
|
||||
#include "blackmisc/network/urllist.h"
|
||||
#include "blackmisc/valueobject.h"
|
||||
@@ -149,7 +149,7 @@ namespace BlackCore
|
||||
};
|
||||
|
||||
//! Trait for global setup data
|
||||
struct GlobalSetup : public BlackCore::CDataTrait<CGlobalSetup>
|
||||
struct GlobalSetup : public BlackMisc::CDataTrait<CGlobalSetup>
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "readers/setup"; }
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#define BLACKCORE_DATA_UPDATEINFO_H
|
||||
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackcore/datacache.h"
|
||||
#include "blackmisc/datacache.h"
|
||||
#include "blackmisc/network/urllist.h"
|
||||
#include "blackmisc/valueobject.h"
|
||||
#include "blackmisc/variant.h"
|
||||
@@ -103,7 +103,7 @@ namespace BlackCore
|
||||
};
|
||||
|
||||
//! Trait for global setup data
|
||||
struct UpdateInfo : public BlackCore::CDataTrait<CUpdateInfo>
|
||||
struct UpdateInfo : public BlackMisc::CDataTrait<CUpdateInfo>
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "readers/updateinfo"; }
|
||||
|
||||
@@ -59,8 +59,8 @@ namespace BlackCore
|
||||
void ps_userChanged();
|
||||
|
||||
private:
|
||||
CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< data cache
|
||||
BlackCore::CData<BlackCore::Data::AuthenticatedUser> m_user {this, &CDatabaseAuthenticationService::ps_userChanged};
|
||||
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< data cache
|
||||
BlackMisc::CData<BlackCore::Data::AuthenticatedUser> m_user {this, &CDatabaseAuthenticationService::ps_userChanged};
|
||||
|
||||
QNetworkAccessManager *m_networkManager = nullptr;
|
||||
bool m_shutdown = false;
|
||||
|
||||
@@ -43,11 +43,11 @@ namespace BlackCore
|
||||
void ps_postResponse(QNetworkReply *nwReplyPtr);
|
||||
|
||||
private:
|
||||
CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< data cache
|
||||
BlackMisc::Network::CUrl m_modelUrl;
|
||||
QNetworkAccessManager *m_networkManager = nullptr;
|
||||
QNetworkReply *m_pendingReply = nullptr;
|
||||
bool m_shutdown = false;
|
||||
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< data cache
|
||||
BlackMisc::Network::CUrl m_modelUrl;
|
||||
QNetworkAccessManager *m_networkManager = nullptr;
|
||||
QNetworkReply *m_pendingReply = nullptr;
|
||||
bool m_shutdown = false;
|
||||
|
||||
//! URL model web service
|
||||
static BlackMisc::Network::CUrl getModelWriteUrl(const BlackMisc::Network::CUrl &baseUrl);
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace BlackCore
|
||||
mutable QReadWriteLock m_lockAircraft;
|
||||
mutable QReadWriteLock m_lockCountry;
|
||||
|
||||
BlackCore::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
|
||||
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
|
||||
|
||||
//! Base URL
|
||||
BlackMisc::Network::CUrl getBaseUrl() const;
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace BlackCore
|
||||
BlackMisc::Input::CHotkeyCombination m_lastCombination;
|
||||
BlackMisc::Input::CHotkeyCombination m_capturedCombination;
|
||||
|
||||
BlackCore::CSetting<BlackCore::Settings::Application::ActionHotkeys> m_actionHotkeys { this, &CInputManager::ps_changeHotkeySettings };
|
||||
BlackMisc::CSetting<BlackCore::Settings::Application::ActionHotkeys> m_actionHotkeys { this, &CInputManager::ps_changeHotkeySettings };
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace BlackCore
|
||||
mutable QReadWriteLock m_lockLivery;
|
||||
mutable QReadWriteLock m_lockModels;
|
||||
|
||||
BlackCore::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
|
||||
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
|
||||
|
||||
//! Base URL
|
||||
BlackMisc::Network::CUrl getBaseUrl() const;
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace BlackCore
|
||||
static int const c_updateIntervalMsec = 5000;
|
||||
static int const c_logoffTimeoutSec = 5;
|
||||
|
||||
CSetting<Settings::Network::WireTextCodec> m_fsdTextCodecSetting { this };
|
||||
BlackMisc::CSetting<Settings::Network::WireTextCodec> m_fsdTextCodecSetting { this };
|
||||
QTextCodec *m_fsdTextCodec = nullptr;
|
||||
|
||||
BlackMisc::Aviation::CAircraftParts m_sentAircraftConfig;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#ifndef BLACKCORE_SETTINGS_APPLICATION_H
|
||||
#define BLACKCORE_SETTINGS_APPLICATION_H
|
||||
|
||||
#include "blackcore/settingscache.h"
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/input/actionhotkeylist.h"
|
||||
|
||||
namespace BlackCore
|
||||
@@ -22,12 +22,12 @@ namespace BlackCore
|
||||
namespace Application
|
||||
{
|
||||
//! User configured hotkeys
|
||||
struct ActionHotkeys : public CSettingTrait<BlackMisc::Input::CActionHotkeyList>
|
||||
struct ActionHotkeys : public BlackMisc::CSettingTrait<BlackMisc::Input::CActionHotkeyList>
|
||||
{
|
||||
//! \copydoc BlackCore::CSettingTrait::key
|
||||
//! \copydoc BlackMisc::CSettingTrait::key
|
||||
static const char *key() { return "application/actionhotkeys"; }
|
||||
|
||||
//! \copydoc BlackCore::CSettingTrait::isValid
|
||||
//! \copydoc BlackMisc::CSettingTrait::isValid
|
||||
static bool isValid(const BlackMisc::Input::CActionHotkeyList &value)
|
||||
{
|
||||
for (const auto &actionHotkey : value)
|
||||
@@ -39,8 +39,8 @@ namespace BlackCore
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#ifndef BLACKCORE_SETTINGS_AUDIO_H
|
||||
#define BLACKCORE_SETTINGS_AUDIO_H
|
||||
|
||||
#include "blackcore/settingscache.h"
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/audio/settings/settingsaudio.h"
|
||||
|
||||
namespace BlackCore
|
||||
@@ -22,15 +22,15 @@ namespace BlackCore
|
||||
namespace Audio
|
||||
{
|
||||
//! Name of text codec to use with text in FSD protocol
|
||||
struct AudioSettings : public CSettingTrait<BlackMisc::Audio::Settings::CSettingsAudio>
|
||||
struct AudioSettings : public BlackMisc::CSettingTrait<BlackMisc::Audio::Settings::CSettingsAudio>
|
||||
{
|
||||
//! \copydoc BlackCore::CSettingTrait::key
|
||||
//! \copydoc BlackMisc::CSettingTrait::key
|
||||
static const char *key() { return "audio/setup"; }
|
||||
|
||||
//! \copydoc BlackCore::CSettingTrait::defaultValue
|
||||
//! \copydoc BlackMisc::CSettingTrait::defaultValue
|
||||
static const BlackMisc::Audio::Settings::CSettingsAudio &defaultValue() { static const BlackMisc::Audio::Settings::CSettingsAudio a; return a; }
|
||||
|
||||
//! \copydoc BlackCore::CSettingTrait::isValid
|
||||
//! \copydoc BlackMisc::CSettingTrait::isValid
|
||||
static bool isValid(const BlackMisc::Audio::Settings::CSettingsAudio &value) { Q_UNUSED(value); return true; }
|
||||
};
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#ifndef BLACKCORE_SETTINGS_NETWORK_H
|
||||
#define BLACKCORE_SETTINGS_NETWORK_H
|
||||
|
||||
#include "blackcore/settingscache.h"
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/network/serverlist.h"
|
||||
#include <QTextCodec>
|
||||
|
||||
@@ -23,32 +23,32 @@ namespace BlackCore
|
||||
namespace Network
|
||||
{
|
||||
//! Name of text codec to use with text in FSD protocol
|
||||
struct WireTextCodec : public CSettingTrait<QString>
|
||||
struct WireTextCodec : public BlackMisc::CSettingTrait<QString>
|
||||
{
|
||||
//! \copydoc BlackCore::CSettingTrait::key
|
||||
//! \copydoc BlackMisc::CSettingTrait::key
|
||||
static const char *key() { return "network/wiretextcodec"; }
|
||||
|
||||
//! \copydoc BlackCore::CSettingTrait::defaultValue
|
||||
//! \copydoc BlackMisc::CSettingTrait::defaultValue
|
||||
static const QString &defaultValue() { static const QString dv("latin1"); return dv; }
|
||||
|
||||
//! \copydoc BlackCore::CSettingTrait::isValid
|
||||
//! \copydoc BlackMisc::CSettingTrait::isValid
|
||||
static bool isValid(const QString &value) { return QTextCodec::codecForName(qPrintable(value)); }
|
||||
};
|
||||
|
||||
//! Virtual air traffic servers
|
||||
struct TrafficServers : public CSettingTrait<BlackMisc::Network::CServerList>
|
||||
struct TrafficServers : public BlackMisc::CSettingTrait<BlackMisc::Network::CServerList>
|
||||
{
|
||||
//! \copydoc BlackCore::CSettingTrait::key
|
||||
//! \copydoc BlackMisc::CSettingTrait::key
|
||||
static const char *key() { return "network/trafficservers"; }
|
||||
};
|
||||
|
||||
//! Currently selected virtual air traffic server
|
||||
struct CurrentTrafficServer : public CSettingTrait<BlackMisc::Network::CServer>
|
||||
struct CurrentTrafficServer : public BlackMisc::CSettingTrait<BlackMisc::Network::CServer>
|
||||
{
|
||||
//! \copydoc BlackCore::CSettingTrait::key
|
||||
//! \copydoc BlackMisc::CSettingTrait::key
|
||||
static const char *key() { return "network/currenttrafficserver"; }
|
||||
|
||||
//! \copydoc BlackCore::CSettingTrait::defaultValue
|
||||
//! \copydoc BlackMisc::CSettingTrait::defaultValue
|
||||
static const BlackMisc::Network::CServer &defaultValue()
|
||||
{
|
||||
using namespace BlackMisc::Network;
|
||||
@@ -58,12 +58,12 @@ namespace BlackCore
|
||||
};
|
||||
|
||||
//! DBus server address
|
||||
struct DBusServerAddress : public CSettingTrait<QString>
|
||||
struct DBusServerAddress : public BlackMisc::CSettingTrait<QString>
|
||||
{
|
||||
//! \copydoc BlackCore::CSettingTrait::key
|
||||
//! \copydoc BlackMisc::CSettingTrait::key
|
||||
static const char *key() { return "network/dbusserver"; }
|
||||
|
||||
//! \copydoc BlackCore::CSettingTrait::defaultValue
|
||||
//! \copydoc BlackMisc::CSettingTrait::defaultValue
|
||||
static const QString &defaultValue() { static const QString dv("session"); return dv; }
|
||||
};
|
||||
} // ns
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
/* Copyright (C) 2013 VATSIM Community / contributors
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef BLACKCORE_SETTINGSALLCLASSES_H
|
||||
#define BLACKCORE_SETTINGSALLCLASSES_H
|
||||
|
||||
#include "blackmisc/settingsblackmiscclasses.h"
|
||||
|
||||
#endif // guard
|
||||
@@ -70,8 +70,8 @@ namespace BlackCore
|
||||
QNetworkAccessManager *m_networkManagerUpdateInfo = nullptr;
|
||||
BlackMisc::LockFree<BlackMisc::Network::CFailoverUrlList> m_bootstrapUrls;
|
||||
BlackMisc::LockFree<BlackMisc::Network::CFailoverUrlList> m_updateInfoUrls;
|
||||
CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< data cache setup
|
||||
CData<BlackCore::Data::UpdateInfo> m_updateInfo {this}; //!< data cache update info
|
||||
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< data cache setup
|
||||
BlackMisc::CData<BlackCore::Data::UpdateInfo> m_updateInfo {this}; //!< data cache update info
|
||||
|
||||
//! Constructor
|
||||
explicit CSetupReader(QObject *owner);
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace BlackCore
|
||||
void ps_read();
|
||||
|
||||
private:
|
||||
BlackCore::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
|
||||
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
|
||||
QNetworkAccessManager *m_networkManager = nullptr;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace BlackCore
|
||||
BlackMisc::Aviation::CAtcStationList m_atcStations;
|
||||
BlackMisc::Simulation::CSimulatedAircraftList m_aircraft;
|
||||
QMap<BlackMisc::Aviation::CCallsign, BlackMisc::Network::CVoiceCapabilities> m_voiceCapabilities;
|
||||
BlackCore::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
|
||||
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);
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace BlackCore
|
||||
QNetworkAccessManager *m_networkManager = nullptr;
|
||||
BlackMisc::Weather::CMetarDecoder m_metarDecoder;
|
||||
BlackMisc::Weather::CMetarSet m_metars;
|
||||
BlackCore::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
|
||||
BlackMisc::CData<BlackCore::Data::GlobalSetup> m_setup {this}; //!< setup cache
|
||||
};
|
||||
}
|
||||
#endif // guard
|
||||
|
||||
@@ -285,7 +285,7 @@ namespace BlackCore
|
||||
CWebReaderFlags::WebReader m_readerFlags = CWebReaderFlags::WebReaderFlag::None; //!< which readers are available
|
||||
int m_autoReadAfterSetupMs = -1; //!< directly read all known readers after setup was syncronized
|
||||
bool m_initialRead = false; //!< Initial read conducted
|
||||
BlackCore::CData<BlackCore::Data::GlobalSetup> m_setup {this, &CWebDataServices::ps_setupChanged}; //!< setup cache
|
||||
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