mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
refs #452, moved global reader settings into settings directory
This commit is contained in:
committed by
Mathew Sutcliffe
parent
a8a26bc281
commit
33330394a9
@@ -24,8 +24,10 @@ precompile_header:!isEmpty(PRECOMPILED_HEADER) {
|
||||
DEFINES += LOG_IN_FILE BUILD_BLACKCORE_LIB
|
||||
|
||||
HEADERS += *.h
|
||||
$$PWD/settings/*.h
|
||||
HEADERS += $$PWD/settings/*.h
|
||||
|
||||
SOURCES += *.cpp
|
||||
SOURCES += $$PWD/settings/*.cpp
|
||||
|
||||
LIBS *= -lvatlib2
|
||||
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#ifndef BLACKCORE_GLOBAL_NETWORKSETTINGS_H
|
||||
#define BLACKCORE_GLOBAL_NETWORKSETTINGS_H
|
||||
|
||||
#include "blackmisc/network/server.h"
|
||||
#include "blackcoreexport.h"
|
||||
#include <QStringList>
|
||||
#include <QObject>
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
//! Settings for readers
|
||||
class BLACKCORE_EXPORT CGlobalNetworkSettings : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! FSD Server
|
||||
const BlackMisc::Network::CServer &swiftFSDTestServer() const { return m_fsdSwiftServer; }
|
||||
|
||||
//! Singleton
|
||||
static const CGlobalNetworkSettings &instance();
|
||||
|
||||
private:
|
||||
//! Default constructor
|
||||
CGlobalNetworkSettings();
|
||||
|
||||
//! Destructor.
|
||||
~CGlobalNetworkSettings() {}
|
||||
|
||||
BlackMisc::Network::CServer m_fsdSwiftServer;
|
||||
};
|
||||
}
|
||||
#endif // guard
|
||||
@@ -1,27 +0,0 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#include "global_reader_settings.h"
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
CGlobalReaderSettings::CGlobalReaderSettings() :
|
||||
m_protocolIcaoReader("http"), m_serverIcaoReader("ubuntu12"), m_baseUrlIcaoReader("vatrep/public"),
|
||||
m_protocolModelReader("http"), m_serverModelReader("ubuntu12"), m_baseUrlModelReader("vatrep/public"),
|
||||
m_bookingsUrl("http://vatbook.euroutepro.com/xml2.php"),
|
||||
m_vatsimDataFileUrls({ "http://info.vroute.net/vatsim-data.txt" }),
|
||||
m_metarUrl("http://metar.vatsim.net/metar.php?id=all")
|
||||
{ }
|
||||
|
||||
const CGlobalReaderSettings &CGlobalReaderSettings::instance()
|
||||
{
|
||||
static const CGlobalReaderSettings rs;
|
||||
return rs;
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#ifndef BLACKCORE_GLOBAL_READERSETTINGS_H
|
||||
#define BLACKCORE_GLOBAL_READERSETTINGS_H
|
||||
|
||||
#include "blackcoreexport.h"
|
||||
#include <QStringList>
|
||||
#include <QObject>
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
//! Settings for readers
|
||||
class BLACKCORE_EXPORT CGlobalReaderSettings : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! ICAO Reader protocol
|
||||
const QString &protocolIcaoReader() const { return m_protocolIcaoReader; }
|
||||
|
||||
//! ICAO Reader server
|
||||
const QString &serverIcaoReader() const { return m_serverIcaoReader; }
|
||||
|
||||
//! ICAO Reader base URL
|
||||
const QString &baseUrlIcaoReader() const { return m_baseUrlIcaoReader; }
|
||||
|
||||
//! Model Reader protocol
|
||||
const QString &protocolModelReader() const { return m_protocolModelReader; }
|
||||
|
||||
//! Model Reader server
|
||||
const QString &serverModelReader() const { return m_serverModelReader; }
|
||||
|
||||
//! Model Reader server
|
||||
const QString &baseUrlModelReader() const { return m_baseUrlModelReader; }
|
||||
|
||||
//! URL to read bookings
|
||||
const QString &bookingsUrl() const { return m_bookingsUrl; }
|
||||
|
||||
//! VATSIM data file URLs
|
||||
const QStringList &vatsimDataFileUrls() const { return m_vatsimDataFileUrls; }
|
||||
|
||||
//! VATSIM metar url
|
||||
const QString &vatsimMetarUrl() const { return m_metarUrl; }
|
||||
|
||||
//! Singleton
|
||||
static const CGlobalReaderSettings &instance();
|
||||
|
||||
private:
|
||||
//! Default constructor
|
||||
CGlobalReaderSettings();
|
||||
|
||||
//! Destructor.
|
||||
~CGlobalReaderSettings() {}
|
||||
|
||||
QString m_protocolIcaoReader;
|
||||
QString m_serverIcaoReader;
|
||||
QString m_baseUrlIcaoReader;
|
||||
QString m_protocolModelReader;
|
||||
QString m_serverModelReader;
|
||||
QString m_baseUrlModelReader;
|
||||
QString m_bookingsUrl;
|
||||
QStringList m_vatsimDataFileUrls;
|
||||
QString m_metarUrl;
|
||||
};
|
||||
}
|
||||
#endif // guard
|
||||
@@ -14,14 +14,18 @@ using namespace BlackMisc::Network;
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
CGlobalNetworkSettings::CGlobalNetworkSettings() :
|
||||
m_fsdSwiftServer("swift", "swift Testserver", "vatsim-germany.org", 6809,
|
||||
CUser("1234567", "swift Test User", "", "123456"), true)
|
||||
{ }
|
||||
|
||||
const CGlobalNetworkSettings &CGlobalNetworkSettings::instance()
|
||||
namespace Settings
|
||||
{
|
||||
static const CGlobalNetworkSettings rs;
|
||||
return rs;
|
||||
}
|
||||
}
|
||||
|
||||
CGlobalNetworkSettings::CGlobalNetworkSettings() :
|
||||
m_fsdSwiftServer("swift", "swift Testserver", "vatsim-germany.org", 6809,
|
||||
CUser("1234567", "swift Test User", "", "123456"), true)
|
||||
{ }
|
||||
|
||||
const CGlobalNetworkSettings &CGlobalNetworkSettings::instance()
|
||||
{
|
||||
static const CGlobalNetworkSettings rs;
|
||||
return rs;
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
45
src/blackcore/settings/global_network_settings.h
Normal file
45
src/blackcore/settings/global_network_settings.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#ifndef BLACKCORE_SETTINGS_GLOBAL_NETWORKSETTINGS_H
|
||||
#define BLACKCORE_SETTINGS_GLOBAL_NETWORKSETTINGS_H
|
||||
|
||||
#include "blackmisc/network/server.h"
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include <QStringList>
|
||||
#include <QObject>
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
namespace Settings
|
||||
{
|
||||
//! Settings for readers
|
||||
class BLACKCORE_EXPORT CGlobalNetworkSettings : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! FSD Server
|
||||
const BlackMisc::Network::CServer &swiftFSDTestServer() const { return m_fsdSwiftServer; }
|
||||
|
||||
//! Singleton
|
||||
static const CGlobalNetworkSettings &instance();
|
||||
|
||||
private:
|
||||
//! Default constructor
|
||||
CGlobalNetworkSettings();
|
||||
|
||||
//! Destructor.
|
||||
~CGlobalNetworkSettings() {}
|
||||
|
||||
BlackMisc::Network::CServer m_fsdSwiftServer;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
#endif // guard
|
||||
29
src/blackcore/settings/global_reader_settings.cpp
Normal file
29
src/blackcore/settings/global_reader_settings.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#include "global_reader_settings.h"
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
namespace Settings
|
||||
{
|
||||
CGlobalReaderSettings::CGlobalReaderSettings() :
|
||||
m_protocolIcaoReader("http"), m_serverIcaoReader("ubuntu12"), m_baseUrlIcaoReader("vatrep/public"),
|
||||
m_protocolModelReader("http"), m_serverModelReader("ubuntu12"), m_baseUrlModelReader("vatrep/public"),
|
||||
m_bookingsUrl("http://vatbook.euroutepro.com/xml2.php"),
|
||||
m_vatsimDataFileUrls({ "http://info.vroute.net/vatsim-data.txt" })
|
||||
{ }
|
||||
|
||||
const CGlobalReaderSettings &CGlobalReaderSettings::instance()
|
||||
{
|
||||
static const CGlobalReaderSettings rs;
|
||||
return rs;
|
||||
}
|
||||
}
|
||||
}
|
||||
72
src/blackcore/settings/global_reader_settings.h
Normal file
72
src/blackcore/settings/global_reader_settings.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#ifndef BLACKCORE_SETTINGS_GLOBAL_READERSETTINGS_H
|
||||
#define BLACKCORE_SETTINGS_GLOBAL_READERSETTINGS_H
|
||||
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include <QStringList>
|
||||
#include <QObject>
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
namespace Settings
|
||||
{
|
||||
//! Settings for readers
|
||||
class BLACKCORE_EXPORT CGlobalReaderSettings : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
//! ICAO Reader protocol
|
||||
const QString &protocolIcaoReader() const { return m_protocolIcaoReader; }
|
||||
|
||||
//! ICAO Reader server
|
||||
const QString &serverIcaoReader() const { return m_serverIcaoReader; }
|
||||
|
||||
//! ICAO Reader base URL
|
||||
const QString &baseUrlIcaoReader() const { return m_baseUrlIcaoReader; }
|
||||
|
||||
//! Model Reader protocol
|
||||
const QString &protocolModelReader() const { return m_protocolModelReader; }
|
||||
|
||||
//! Model Reader server
|
||||
const QString &serverModelReader() const { return m_serverModelReader; }
|
||||
|
||||
//! Model Reader server
|
||||
const QString &baseUrlModelReader() const { return m_baseUrlModelReader; }
|
||||
|
||||
//! URL to read bookings
|
||||
const QString &bookingsUrl() const { return m_bookingsUrl; }
|
||||
|
||||
//! VATSIM data file URLs
|
||||
const QStringList &vatsimDataFileUrls() const { return m_vatsimDataFileUrls; }
|
||||
|
||||
//! Singleton
|
||||
static const CGlobalReaderSettings &instance();
|
||||
|
||||
private:
|
||||
//! Default constructor
|
||||
CGlobalReaderSettings();
|
||||
|
||||
//! Destructor.
|
||||
~CGlobalReaderSettings() {}
|
||||
|
||||
QString m_protocolIcaoReader;
|
||||
QString m_serverIcaoReader;
|
||||
QString m_baseUrlIcaoReader;
|
||||
QString m_protocolModelReader;
|
||||
QString m_serverModelReader;
|
||||
QString m_baseUrlModelReader;
|
||||
QString m_bookingsUrl;
|
||||
QStringList m_vatsimDataFileUrls;
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user