From 02733cacb7d97da2e623a8dd70af824d160253da Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 17 Nov 2015 02:23:04 +0100 Subject: [PATCH] refs #507, adjusted resource subproject --- .../bootstrap/0.6/development/bootstrap.json | 61 ------------------- .../bootstrap/0.6/productive/bootstrap.json | 61 ------------------- .../bootstrap/bootstrap.json | 44 +++++++------ resources/shared/bootstrap/bootstrap.json | 39 ++++++++++++ .../dbdata}/aircrafticao.json | 0 .../dbdata}/airlineicao.json | 0 .../{swiftDB => shared/dbdata}/countries.json | 0 .../dbdata}/distributors.json | 0 .../{swiftDB => shared/dbdata}/liveries.json | 0 .../{swiftDB => shared/dbdata}/models.json | 0 resources/shared/download/download.json | 22 +++++++ resources/swiftresources.pro | 17 +++--- .../components/datainfoareacomponent.cpp | 2 +- src/blackmisc/project.cpp | 20 +++--- src/swiftdata/swiftdata_menus.cpp | 6 +- 15 files changed, 109 insertions(+), 163 deletions(-) delete mode 100644 resources/bootstrap/0.6/development/bootstrap.json delete mode 100644 resources/bootstrap/0.6/productive/bootstrap.json create mode 100644 resources/shared/bootstrap/bootstrap.json rename resources/{swiftDB => shared/dbdata}/aircrafticao.json (100%) rename resources/{swiftDB => shared/dbdata}/airlineicao.json (100%) rename resources/{swiftDB => shared/dbdata}/countries.json (100%) rename resources/{swiftDB => shared/dbdata}/distributors.json (100%) rename resources/{swiftDB => shared/dbdata}/liveries.json (100%) rename resources/{swiftDB => shared/dbdata}/models.json (100%) create mode 100644 resources/shared/download/download.json diff --git a/resources/bootstrap/0.6/development/bootstrap.json b/resources/bootstrap/0.6/development/bootstrap.json deleted file mode 100644 index 530e6f5ec..000000000 --- a/resources/bootstrap/0.6/development/bootstrap.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "bootstrap": { - "containerbase": [ - { - "url": "https://vatsim-germany.org:50443/mapping/public/bootstrap" - }, - { - "url": "http://ubuntu12/swiftdatastore/public/bootstrap" - } - ] - }, - "dbHttpPort": 80, - "dbHttpsPort": 443, - "dbRootDirectory": { - "url": "http://ubuntu12/swiftdatastore/public" - }, - "fsdTestServers": { - "containerbase": [ - { - "address": "vatsim-germany.org", - "description": "swift Testserver", - "isAcceptingConnections": true, - "name": "swift", - "port": 6809, - "user": { - "callsign": { - "callsign": "", - "callsignAsSet": "", - "telephonyDesignator": "", - "typeHint": 0 - }, - "email": "", - "homebase": { - "icaoCode": "" - }, - "id": "1234567", - "password": "123456", - "realname": "Swift Test User" - } - } - ] - }, - "swiftDbDataFiles": { - "containerbase": [ - ] - }, - "timestampMSecsSinceEpoch": 1445201830000, - "vatsimBookings": { - "url": "http://vatbook.euroutepro.com/xml2.php" - }, - "vatsimDataFile": { - "containerbase": [ - { - "url": "http://info.vroute.net/vatsim-data.txt" - } - ] - }, - "vatsimMetars": { - "url": "http://metar.vatsim.net/metar.php" - } -} diff --git a/resources/bootstrap/0.6/productive/bootstrap.json b/resources/bootstrap/0.6/productive/bootstrap.json deleted file mode 100644 index 5d2b2879b..000000000 --- a/resources/bootstrap/0.6/productive/bootstrap.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "bootstrap": { - "containerbase": [ - { - "url": "https://vatsim-germany.org:50443/mapping/public/bootstrap" - }, - { - "url": "http://ubuntu12/swiftdatastore/public/bootstrap" - } - ] - }, - "dbHttpPort": 5080, - "dbHttpsPort": 50443, - "dbRootDirectory": { - "url": "https://vatsim-germany.org:50443/mapping/public" - }, - "fsdTestServers": { - "containerbase": [ - { - "address": "vatsim-germany.org", - "description": "swift Testserver", - "isAcceptingConnections": true, - "name": "swift", - "port": 6809, - "user": { - "callsign": { - "callsign": "", - "callsignAsSet": "", - "telephonyDesignator": "", - "typeHint": 0 - }, - "email": "", - "homebase": { - "icaoCode": "" - }, - "id": "1234567", - "password": "123456", - "realname": "Swift Test User" - } - } - ] - }, - "swiftDbDataFiles": { - "containerbase": [ - ] - }, - "timestampMSecsSinceEpoch": 1445201830000, - "vatsimBookings": { - "url": "http://vatbook.euroutepro.com/xml2.php" - }, - "vatsimDataFile": { - "containerbase": [ - { - "url": "http://info.vroute.net/vatsim-data.txt" - } - ] - }, - "vatsimMetars": { - "url": "http://metar.vatsim.net/metar.php" - } -} diff --git a/resources/local.env.template/bootstrap/bootstrap.json b/resources/local.env.template/bootstrap/bootstrap.json index 5d2b2879b..dead57545 100644 --- a/resources/local.env.template/bootstrap/bootstrap.json +++ b/resources/local.env.template/bootstrap/bootstrap.json @@ -1,19 +1,10 @@ { - "bootstrap": { - "containerbase": [ - { - "url": "https://vatsim-germany.org:50443/mapping/public/bootstrap" - }, - { - "url": "http://ubuntu12/swiftdatastore/public/bootstrap" - } - ] - }, - "dbHttpPort": 5080, - "dbHttpsPort": 50443, - "dbRootDirectory": { - "url": "https://vatsim-germany.org:50443/mapping/public" + "dbHttpPort": 80, + "dbHttpsPort": 443, + "dbRootDirectoryUrl": { + "url": "http://ubuntu12/swiftdatastore/public" }, + "development": false, "fsdTestServers": { "containerbase": [ { @@ -40,22 +31,35 @@ } ] }, - "swiftDbDataFiles": { + "sharedUrls": { "containerbase": [ + { + "url": "https://vatsim-germany.org:50443/mapping/public/shared" + }, + { + "url": "http://ubuntu12/public/bootstrap/shared" + } ] }, - "timestampMSecsSinceEpoch": 1445201830000, - "vatsimBookings": { + "timestampMSecsSinceEpoch": 0, + "vatsimBookingsUrl": { "url": "http://vatbook.euroutepro.com/xml2.php" }, - "vatsimDataFile": { + "vatsimDataFileUrls": { "containerbase": [ { "url": "http://info.vroute.net/vatsim-data.txt" } ] }, - "vatsimMetars": { + "vatsimMetarsUrl": { "url": "http://metar.vatsim.net/metar.php" + }, + "newsUrls": { + "containerbase": [ + { + "url": "http://swift-project.org/" + } + ] } -} +} \ No newline at end of file diff --git a/resources/shared/bootstrap/bootstrap.json b/resources/shared/bootstrap/bootstrap.json new file mode 100644 index 000000000..7a32758e8 --- /dev/null +++ b/resources/shared/bootstrap/bootstrap.json @@ -0,0 +1,39 @@ +{ + "dbHttpPort": 5080, + "dbHttpsPort": 50443, + "dbRootDirectoryUrl": { + "url": "https://vatsim-germany.org:50443/mapping/public" + }, + "development": false, + "sharedUrls": { + "containerbase": [ + { + "url": "https://vatsim-germany.org:50443/mapping/public/shared" + }, + { + "url": "http://ubuntu12/public/bootstrap/shared" + } + ] + }, + "timestampMSecsSinceEpoch": 0, + "vatsimBookingsUrl": { + "url": "http://vatbook.euroutepro.com/xml2.php" + }, + "vatsimDataFileUrls": { + "containerbase": [ + { + "url": "http://info.vroute.net/vatsim-data.txt" + } + ] + }, + "vatsimMetarsUrl": { + "url": "http://metar.vatsim.net/metar.php" + }, + "newsUrls": { + "containerbase": [ + { + "url": "http://swift-project.org/" + } + ] + } +} \ No newline at end of file diff --git a/resources/swiftDB/aircrafticao.json b/resources/shared/dbdata/aircrafticao.json similarity index 100% rename from resources/swiftDB/aircrafticao.json rename to resources/shared/dbdata/aircrafticao.json diff --git a/resources/swiftDB/airlineicao.json b/resources/shared/dbdata/airlineicao.json similarity index 100% rename from resources/swiftDB/airlineicao.json rename to resources/shared/dbdata/airlineicao.json diff --git a/resources/swiftDB/countries.json b/resources/shared/dbdata/countries.json similarity index 100% rename from resources/swiftDB/countries.json rename to resources/shared/dbdata/countries.json diff --git a/resources/swiftDB/distributors.json b/resources/shared/dbdata/distributors.json similarity index 100% rename from resources/swiftDB/distributors.json rename to resources/shared/dbdata/distributors.json diff --git a/resources/swiftDB/liveries.json b/resources/shared/dbdata/liveries.json similarity index 100% rename from resources/swiftDB/liveries.json rename to resources/shared/dbdata/liveries.json diff --git a/resources/swiftDB/models.json b/resources/shared/dbdata/models.json similarity index 100% rename from resources/swiftDB/models.json rename to resources/shared/dbdata/models.json diff --git a/resources/shared/download/download.json b/resources/shared/download/download.json new file mode 100644 index 000000000..62eeecb71 --- /dev/null +++ b/resources/shared/download/download.json @@ -0,0 +1,22 @@ +{ + "development": false, + "downloadsBetaUrls": { + "containerbase": [ + { + "url": "http://swift-project.org/" + } + ] + }, + "downloadsStableUrls": { + "containerbase": [ + { + "url": "http://swift-project.org/" + } + ] + }, + "lastSupportedVersionBeta": "0.6", + "lastSupportedVersionStable": "0.6", + "latestVersionBeta": "0.6.1", + "latestVersionStable": "0.6.1", + "timestampMSecsSinceEpoch": 0 +} diff --git a/resources/swiftresources.pro b/resources/swiftresources.pro index 1e5421279..405d008fa 100644 --- a/resources/swiftresources.pro +++ b/resources/swiftresources.pro @@ -6,26 +6,23 @@ CONFIG -= qt OTHER_FILES += data/images/flags/*.png OTHER_FILES += data/images/airlines/*.png -OTHER_FILES += swiftDB/*.* -OTHER_FILES += bootstrap/productive/*.* -OTHER_FILES += bootstrap/development/*.* OTHER_FILES += local.env.template/*.* OTHER_FILES += local.env.template/bootstrap/*.* -OTHER_FILES += local.env.template/bootstrap/0.6/*.* +OTHER_FILES += shared//bootstrap/*.* +OTHER_FILES += shared/dbdata/*.* +OTHER_FILES += shared/download/*.* COPY_FILES += $$PWD/data/images/flags/*.png COPY_FILES += $$PWD/data/images/airlines/*.png -COPY_FILES += $$PWD/swiftDB/*.* -COPY_FILES += $$PWD/bootstrap/productive/*.* -COPY_FILES += $$PWD/bootstrap/development/*.* COPY_FILES += $$PWD/local.env.template/*.* COPY_FILES += $$PWD/local.env.template/bootstrap/*.* -COPY_FILES += $$PWD/local.env.template/bootstrap/0.6/*.* +COPY_FILES += $$PWD/shared/bootstrap/*.* +COPY_FILES += $$PWD/shared/dbdata/*.* +COPY_FILES += $$PWD/shared/download/*.* package_resources.path = $$PREFIX package_resources.files += data -package_resources.files += swiftDB -package_resources.files += bootstrap +package_resources.files += shared package_resources.files += local.env.template INSTALLS += package_resources diff --git a/src/blackgui/components/datainfoareacomponent.cpp b/src/blackgui/components/datainfoareacomponent.cpp index 0a5f1ff63..21d67d3fc 100644 --- a/src/blackgui/components/datainfoareacomponent.cpp +++ b/src/blackgui/components/datainfoareacomponent.cpp @@ -100,7 +100,7 @@ namespace BlackGui // info if (s) { - CLogMessage(this).info("Read DB data"); + CLogMessage(this).info("Read DB data: %1") << CProject::getSwiftStaticDbFilesDir(); this->ui->comp_DbAircraftIcao->showLoadIndicator(); this->ui->comp_DbAirlineIcao->showLoadIndicator(); this->ui->comp_DbCountries->showLoadIndicator(); diff --git a/src/blackmisc/project.cpp b/src/blackmisc/project.cpp index 0cb466b48..b25b4dce1 100644 --- a/src/blackmisc/project.cpp +++ b/src/blackmisc/project.cpp @@ -324,7 +324,12 @@ namespace BlackMisc QString getSwiftResourceDirImpl() { QDir dir(CProject::getApplicationDir()); - if (dir.cdUp()) { return dir.absolutePath(); } + if (dir.cdUp()) + { + Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir"); + return dir.absolutePath(); + } + Q_ASSERT_X(false, Q_FUNC_INFO, "missing dir"); return ""; } @@ -344,22 +349,23 @@ namespace BlackMisc { QString d(CProject::getSwiftResourceDir()); if (d.isEmpty()) { return ""; } - QDir dir(d); - if (dir.cd("swiftDB")) { return dir.absolutePath(); } - return ""; + QDir dir(CFileUtils::appendFilePaths(d, "shared/dbdata")); + Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir"); + return dir.absolutePath(); } const QString &CProject::getSwiftStaticDbFilesDir() { - static QString s(getSwiftResourceDirImpl()); + static QString s(getSwiftStaticDbFilesDirImpl()); return s; } QString getImagesDirImpl() { QString d(CProject::getSwiftResourceDir()); - if (d.isEmpty()) return ""; - return CFileUtils::appendFilePaths(d, "data/images"); + QDir dir(CFileUtils::appendFilePaths(d, "data/images")); + Q_ASSERT_X(dir.exists(), Q_FUNC_INFO, "missing dir"); + return dir.absolutePath(); } const QString &CProject::getImagesDir() diff --git a/src/swiftdata/swiftdata_menus.cpp b/src/swiftdata/swiftdata_menus.cpp index 68cd7412a..5d1b5a420 100644 --- a/src/swiftdata/swiftdata_menus.cpp +++ b/src/swiftdata/swiftdata_menus.cpp @@ -145,12 +145,12 @@ void CSwiftData::ps_setupChanged() void CSwiftData::initDynamicMenus() { - Q_ASSERT(this->ui->menu_InfoAreas); - Q_ASSERT(this->ui->comp_MainInfoArea); + Q_ASSERT_X(this->ui->menu_InfoAreas, Q_FUNC_INFO, "missing info areas"); + Q_ASSERT_X(this->ui->comp_MainInfoArea, Q_FUNC_INFO, "missing main area"); this->ui->menu_InfoAreas->addActions(this->ui->comp_MainInfoArea->getInfoAreaSelectActions(this->ui->menu_InfoAreas)); QString resourceDir(CProject::getSwiftResourceDir()); - if (!resourceDir.isEmpty()) + if (!resourceDir.isEmpty() && QDir(resourceDir).exists()) { Q_ASSERT_X(this->ui->comp_MainInfoArea, Q_FUNC_INFO, "Missing main info area"); Q_ASSERT_X(this->ui->comp_MainInfoArea->getDataInfoAreaComponent(), Q_FUNC_INFO, "Missing DB info area");