mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
Ref T709, changed to "static" settings as it needs to be used in static functions such as "CTraffic::preferences"
This commit is contained in:
committed by
Mat Sutcliffe
parent
f2f9ee8818
commit
1440c4d2e9
@@ -6,7 +6,6 @@
|
||||
* or distributed except according to the terms contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
|
||||
#include "service.h"
|
||||
#include "utils.h"
|
||||
#include "blackmisc/simulation/xplane/qtfreeutils.h"
|
||||
@@ -22,8 +21,11 @@ using namespace BlackMisc::Simulation::XPlane::QtFreeUtils;
|
||||
|
||||
namespace XSwiftBus
|
||||
{
|
||||
CService::CService(CSettings &settings) : CDBusObject(), m_pluginSettings(settings)
|
||||
CSettings *CService::s_pluginSettings = nullptr;
|
||||
|
||||
CService::CService(CSettings *staticSettings) : CDBusObject()
|
||||
{
|
||||
CService::s_pluginSettings = staticSettings;
|
||||
updateAirportsInRange();
|
||||
}
|
||||
|
||||
@@ -159,15 +161,15 @@ namespace XSwiftBus
|
||||
|
||||
std::string CService::getSettings() const
|
||||
{
|
||||
return m_pluginSettings.toXSwiftBusJsonString();
|
||||
return CService::s_pluginSettings->toXSwiftBusJsonString();
|
||||
}
|
||||
|
||||
void CService::setSettings(const std::string &jsonString)
|
||||
{
|
||||
m_pluginSettings.parseXSwiftBusString(jsonString);
|
||||
CService::s_pluginSettings->parseXSwiftBusString(jsonString);
|
||||
|
||||
XPLMDebugString("Received settings ");
|
||||
XPLMDebugString(m_pluginSettings.convertToString().c_str());
|
||||
XPLMDebugString(CService::s_pluginSettings->convertToString().c_str());
|
||||
XPLMDebugString("\n");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user