mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
Ref T709, changed to settings provider
* CPlugin is the provider * it is "kept" in DBus object for traffic, service, weather
This commit is contained in:
committed by
Mat Sutcliffe
parent
97926eee26
commit
f9c87326fb
@@ -6,6 +6,7 @@
|
||||
* or distributed except according to the terms contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "plugin.h"
|
||||
#include "service.h"
|
||||
#include "utils.h"
|
||||
#include "blackmisc/simulation/xplane/qtfreeutils.h"
|
||||
@@ -21,11 +22,8 @@ using namespace BlackMisc::Simulation::XPlane::QtFreeUtils;
|
||||
|
||||
namespace XSwiftBus
|
||||
{
|
||||
CSettings *CService::s_pluginSettings = nullptr;
|
||||
|
||||
CService::CService(CSettings *staticSettings) : CDBusObject()
|
||||
CService::CService(ISettingsProvider *settingsProvider) : CDBusObject(settingsProvider)
|
||||
{
|
||||
CService::s_pluginSettings = staticSettings;
|
||||
updateAirportsInRange();
|
||||
}
|
||||
|
||||
@@ -161,13 +159,14 @@ namespace XSwiftBus
|
||||
|
||||
std::string CService::getSettings() const
|
||||
{
|
||||
return CService::s_pluginSettings->toXSwiftBusJsonString();
|
||||
return s_settingsProvider->getSettings().toXSwiftBusJsonString();
|
||||
}
|
||||
|
||||
void CService::setSettings(const std::string &jsonString)
|
||||
{
|
||||
CService::s_pluginSettings->parseXSwiftBusString(jsonString);
|
||||
INFO_LOG("Received settings " + s_pluginSettings->convertToString());
|
||||
const CSettings s(jsonString);
|
||||
s_settingsProvider->setSettings(s);
|
||||
INFO_LOG("Received settings " + s.convertToString());
|
||||
}
|
||||
|
||||
void CService::readAirportsDatabase()
|
||||
|
||||
Reference in New Issue
Block a user