diff --git a/src/blackcore/blackcore.pro b/src/blackcore/blackcore.pro index a355fab06..1d09a729f 100644 --- a/src/blackcore/blackcore.pro +++ b/src/blackcore/blackcore.pro @@ -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 diff --git a/src/blackcore/global_network_settings.h b/src/blackcore/global_network_settings.h deleted file mode 100644 index 91bb55a4f..000000000 --- a/src/blackcore/global_network_settings.h +++ /dev/null @@ -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 -#include - -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 diff --git a/src/blackcore/global_reader_settings.cpp b/src/blackcore/global_reader_settings.cpp deleted file mode 100644 index 5733d7a5b..000000000 --- a/src/blackcore/global_reader_settings.cpp +++ /dev/null @@ -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; - } -} diff --git a/src/blackcore/global_reader_settings.h b/src/blackcore/global_reader_settings.h deleted file mode 100644 index 2049a087a..000000000 --- a/src/blackcore/global_reader_settings.h +++ /dev/null @@ -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 -#include - -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 diff --git a/src/blackcore/global_network_settings.cpp b/src/blackcore/settings/global_network_settings.cpp similarity index 55% rename from src/blackcore/global_network_settings.cpp rename to src/blackcore/settings/global_network_settings.cpp index 81d1a2375..ea5fab6de 100644 --- a/src/blackcore/global_network_settings.cpp +++ b/src/blackcore/settings/global_network_settings.cpp @@ -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 diff --git a/src/blackcore/settings/global_network_settings.h b/src/blackcore/settings/global_network_settings.h new file mode 100644 index 000000000..df4d3647b --- /dev/null +++ b/src/blackcore/settings/global_network_settings.h @@ -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 +#include + +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 diff --git a/src/blackcore/settings/global_reader_settings.cpp b/src/blackcore/settings/global_reader_settings.cpp new file mode 100644 index 000000000..70f5518a9 --- /dev/null +++ b/src/blackcore/settings/global_reader_settings.cpp @@ -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; + } + } +} diff --git a/src/blackcore/settings/global_reader_settings.h b/src/blackcore/settings/global_reader_settings.h new file mode 100644 index 000000000..8a1764cc9 --- /dev/null +++ b/src/blackcore/settings/global_reader_settings.h @@ -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 +#include + +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