mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
refs #534 use cached data / settings
* models * vPilot rules * DBus address
This commit is contained in:
@@ -42,12 +42,17 @@ namespace BlackCore
|
||||
|
||||
this->connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, this, &CRuntime::gracefulShutdown);
|
||||
|
||||
// upfront reading of settings, as DBus server already relies on settings
|
||||
// either use explicit setting or last value
|
||||
QString dbusAddress;
|
||||
|
||||
//! \todo Change when settings ready RW: I wonder if this can be done cleaner.
|
||||
if (config.hasDBusAddress()) { dbusAddress = config.getDBusAddress(); } // bootstrap / explicit
|
||||
else { dbusAddress = m_dbusServerAddress.get(); }
|
||||
if (config.hasDBusAddress())
|
||||
{
|
||||
dbusAddress = config.getDBusAddress();
|
||||
m_dbusServerAddress.set(dbusAddress);
|
||||
}
|
||||
else
|
||||
{
|
||||
dbusAddress = m_dbusServerAddress.get();
|
||||
}
|
||||
|
||||
// DBus
|
||||
if (config.requiresDBusSever()) { this->initDBusServer(dbusAddress); }
|
||||
|
||||
55
src/blackcore/data/aircraftmodels.h
Normal file
55
src/blackcore/data/aircraftmodels.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/* Copyright (C) 2015
|
||||
* swift project community / contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKCORE_DATA_AIRCRAFTMODELS_H
|
||||
#define BLACKCORE_DATA_AIRCRAFTMODELS_H
|
||||
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackcore/datacache.h"
|
||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||
#include "blackmisc/variant.h"
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
namespace Data
|
||||
{
|
||||
//! Trait for own simulator models
|
||||
struct OwnSimulatorAircraftModels : public BlackCore::CDataTrait<BlackMisc::Simulation::CAircraftModelList>
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "simulator/models"; }
|
||||
|
||||
//! Default value
|
||||
static const BlackMisc::Simulation::CAircraftModelList &defaultValue()
|
||||
{
|
||||
static const BlackMisc::Simulation::CAircraftModelList defaultValue;
|
||||
return defaultValue;
|
||||
}
|
||||
};
|
||||
|
||||
//! Trait for vPilot derived models
|
||||
struct VPilotAircraftModels : public BlackCore::CDataTrait<BlackMisc::Simulation::CAircraftModelList>
|
||||
{
|
||||
//! Key in data cache
|
||||
static const char *key() { return "vpilot/models"; }
|
||||
|
||||
//! Default value
|
||||
static const BlackMisc::Simulation::CAircraftModelList &defaultValue()
|
||||
{
|
||||
static const BlackMisc::Simulation::CAircraftModelList defaultValue;
|
||||
return defaultValue;
|
||||
}
|
||||
};
|
||||
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user