refs #478, setup class containing the fundamental URLs and locations

Removed the old class CGlobalNetworkSettings
This commit is contained in:
Klaus Basan
2015-10-14 02:00:14 +02:00
committed by Mathew Sutcliffe
parent a725ce2181
commit cba40a8ca4
9 changed files with 285 additions and 194 deletions

View File

@@ -1,31 +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_network_settings.h"
#include "blackmisc/network/user.h"
using namespace BlackMisc::Network;
namespace BlackCore
{
namespace Settings
{
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

@@ -1,45 +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_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

@@ -1,35 +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
{
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_metarUrl("http://metar.vatsim.net/metar.php"),
m_vatsimDataFileUrls({ "http://info.vroute.net/vatsim-data.txt" })
{ }
QString CGlobalReaderSettings::urlVatsimMetars() const
{
return m_metarUrl + "?id=all";
}
const CGlobalReaderSettings &CGlobalReaderSettings::instance()
{
static const CGlobalReaderSettings rs;
return rs;
}
} // ns
} // ns

View File

@@ -1,79 +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_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 VATSIM bookings
const QString &bookingsUrl() const { return m_bookingsUrl; }
//! VATSIM data file URLs
const QStringList &vatsimDataFileUrls() const { return m_vatsimDataFileUrls; }
//! VATSIM METAR URL
const QString &baseUrlVatsimMetars() const { return m_metarUrl; }
//! VATSIM METAR URL (with query string)
QString urlVatsimMetars() const;
//! 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;
QString m_metarUrl;
QStringList m_vatsimDataFileUrls;
};
}
}
#endif // guard