refs #452, moved global reader settings into settings directory

This commit is contained in:
Klaus Basan
2015-09-23 18:45:24 +02:00
committed by Mathew Sutcliffe
parent a8a26bc281
commit 33330394a9
8 changed files with 163 additions and 153 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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;
}
}

View File

@@ -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

View File

@@ -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

View 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

View 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;
}
}
}

View 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