mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
Ref T125, X-Plan utility functions and moved XSwiftBus settings in own file
This commit is contained in:
committed by
Mathew Sutcliffe
parent
104d869c19
commit
65bd2d20ad
43
src/blackmisc/simulation/settings/xswiftbussettings.h
Normal file
43
src/blackmisc/simulation/settings/xswiftbussettings.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/* Copyright (C) 2017
|
||||
* 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 BLACKMISC_SIMULATION_SETTINGS_XSWIFTBUSSETTINGS_H
|
||||
#define BLACKMISC_SIMULATION_SETTINGS_XSWIFTBUSSETTINGS_H
|
||||
|
||||
#include <QString>
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/dbusserver.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
{
|
||||
namespace Settings
|
||||
{
|
||||
/*!
|
||||
* Setting for XSwiftBus.
|
||||
*/
|
||||
struct TXSwiftBusServer : public BlackMisc::TSettingTrait<QString>
|
||||
{
|
||||
//! \copydoc BlackMisc::TSettingTrait::key
|
||||
static const char *key() { return "xswiftbus/server"; }
|
||||
|
||||
//! \copydoc BlackMisc::TSettingTrait::defaultValue
|
||||
static QString defaultValue() { return BlackMisc::CDBusServer::sessionBusAddress(); }
|
||||
|
||||
//! \copydoc BlackMisc::TSettingTrait::defaultValue
|
||||
static bool isValid(const QString &dBusAddress) { return BlackMisc::CDBusServer::isSessionOrSystemAddress(dBusAddress); }
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user