From 332c2edf54964ddf47ecb47357a924de4c5a5b23 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Tue, 30 Jan 2024 10:49:08 +0100 Subject: [PATCH] refactor: Remove remaining ATC booking parts Related to #252 --- src/blackcore/airspacemonitor.cpp | 1 - src/blackcore/vatsim/vatsimmetarreader.h | 2 +- src/blackcore/vatsim/vatsimsettings.h | 21 ---------------- src/blackcore/webdataservices.h | 1 - .../settingsvatsimreaderscomponent.cpp | 8 ------ .../settingsvatsimreaderscomponent.h | 1 - .../settingsvatsimreaderscomponent.ui | 25 +------------------ tests/blackcore/testreaders/testreaders.cpp | 2 +- 8 files changed, 3 insertions(+), 58 deletions(-) diff --git a/src/blackcore/airspacemonitor.cpp b/src/blackcore/airspacemonitor.cpp index 914aa569e0..3b84760f89 100644 --- a/src/blackcore/airspacemonitor.cpp +++ b/src/blackcore/airspacemonitor.cpp @@ -90,7 +90,6 @@ namespace BlackCore connect(m_fsdClient, &CFSDClient::connectionStatusChanged, this, &CAirspaceMonitor::onConnectionStatusChanged); connect(m_fsdClient, &CFSDClient::revbAircraftConfigReceived, this, &CAirspaceMonitor::onRevBAircraftConfigReceived); - // AutoConnection: this should also avoid race conditions by updating the bookings Q_ASSERT_X(sApp && sApp->hasWebDataServices(), Q_FUNC_INFO, "Missing data reader"); if (this->supportsVatsimDataFile()) diff --git a/src/blackcore/vatsim/vatsimmetarreader.h b/src/blackcore/vatsim/vatsimmetarreader.h index b3914de2b1..85e703ed20 100644 --- a/src/blackcore/vatsim/vatsimmetarreader.h +++ b/src/blackcore/vatsim/vatsimmetarreader.h @@ -32,7 +32,7 @@ namespace BlackCore::Vatsim //! Constructor explicit CVatsimMetarReader(QObject *owner); - //! Read / re-read bookings + //! Read / re-read metars void readInBackgroundThread(); //! Get METARs diff --git a/src/blackcore/vatsim/vatsimsettings.h b/src/blackcore/vatsim/vatsimsettings.h index ca257f5519..e8282630a6 100644 --- a/src/blackcore/vatsim/vatsimsettings.h +++ b/src/blackcore/vatsim/vatsimsettings.h @@ -80,27 +80,6 @@ namespace BlackCore::Vatsim ); }; - //! Reader settings - struct TVatsimBookings : public BlackMisc::TSettingTrait - { - //! \copydoc BlackMisc::TSettingTrait::key - static const char *key() { return "vatsimreaders/bookings"; } - - //! \copydoc BlackMisc::TSettingTrait::humanReadable - static const QString &humanReadable() - { - static const QString name("VATSIM bookings"); - return name; - } - - //! \copydoc BlackMisc::TSettingTrait::defaultValue - static const BlackCore::Vatsim::CReaderSettings &defaultValue() - { - static const BlackCore::Vatsim::CReaderSettings reader { { 30.0, BlackMisc::PhysicalQuantities::CTimeUnit::s() }, { 600.0, BlackMisc::PhysicalQuantities::CTimeUnit::s() } }; - return reader; - } - }; - //! Reader settings struct TVatsimDataFile : public BlackMisc::TSettingTrait { diff --git a/src/blackcore/webdataservices.h b/src/blackcore/webdataservices.h index f4cc5d5513..f1f9b9c331 100644 --- a/src/blackcore/webdataservices.h +++ b/src/blackcore/webdataservices.h @@ -62,7 +62,6 @@ namespace BlackCore namespace Vatsim { - class CVatsimBookingReader; class CVatsimDataFileReader; class CVatsimMetarReader; class CVatsimStatusFileReader; diff --git a/src/blackgui/components/settingsvatsimreaderscomponent.cpp b/src/blackgui/components/settingsvatsimreaderscomponent.cpp index 881b26f35f..4c35c569d4 100644 --- a/src/blackgui/components/settingsvatsimreaderscomponent.cpp +++ b/src/blackgui/components/settingsvatsimreaderscomponent.cpp @@ -31,7 +31,6 @@ namespace BlackGui::Components void CSettingsVatsimReadersComponent::save() { const int metarSec = m_settingsMetars.get().getPeriodicTime().toMs() / 1000; - const int bookingsSec = m_settingsBookings.get().getPeriodicTime().toMs() / 1000; const int dataFileSec = m_settingsDataFile.get().getPeriodicTime().toMs() / 1000; const int newMetarSec = ui->sb_Metar->value(); @@ -39,11 +38,6 @@ namespace BlackGui::Components { m_settingsMetars.setAndSaveProperty(CReaderSettings::IndexPeriodicTime, CVariant::fromValue(CTime { static_cast(newMetarSec), CTimeUnit::s() })); } - const int newBookingsSec = ui->sb_Bookings->value(); - if (newBookingsSec != bookingsSec) - { - m_settingsBookings.setAndSaveProperty(CReaderSettings::IndexPeriodicTime, CVariant::fromValue(CTime { static_cast(newBookingsSec), CTimeUnit::s() })); - } const int newDataFileSec = ui->sb_DataFile->value(); if (newDataFileSec != dataFileSec) { @@ -59,11 +53,9 @@ namespace BlackGui::Components void CSettingsVatsimReadersComponent::initValues() { const int metarSec = m_settingsMetars.get().getPeriodicTime().toMs() / 1000; - const int bookingsSec = m_settingsBookings.get().getPeriodicTime().toMs() / 1000; const int dataFileSec = m_settingsDataFile.get().getPeriodicTime().toMs() / 1000; ui->sb_Metar->setValue(metarSec); - ui->sb_Bookings->setValue(bookingsSec); ui->sb_DataFile->setValue(dataFileSec); } } // ns diff --git a/src/blackgui/components/settingsvatsimreaderscomponent.h b/src/blackgui/components/settingsvatsimreaderscomponent.h index 12828c47c0..55b186d5bf 100644 --- a/src/blackgui/components/settingsvatsimreaderscomponent.h +++ b/src/blackgui/components/settingsvatsimreaderscomponent.h @@ -38,7 +38,6 @@ namespace BlackGui::Components void initValues(); QScopedPointer ui; - BlackMisc::CSetting m_settingsBookings { this, &CSettingsVatsimReadersComponent::onSettingsChanged }; BlackMisc::CSetting m_settingsDataFile { this, &CSettingsVatsimReadersComponent::onSettingsChanged }; BlackMisc::CSetting m_settingsMetars { this, &CSettingsVatsimReadersComponent::onSettingsChanged }; }; diff --git a/src/blackgui/components/settingsvatsimreaderscomponent.ui b/src/blackgui/components/settingsvatsimreaderscomponent.ui index 1024039ac3..069630abd6 100644 --- a/src/blackgui/components/settingsvatsimreaderscomponent.ui +++ b/src/blackgui/components/settingsvatsimreaderscomponent.ui @@ -66,30 +66,7 @@ - - - - Bookings (secs.) - - - - - - - 10 - - - 500 - - - 1 - - - 30 - - - - + diff --git a/tests/blackcore/testreaders/testreaders.cpp b/tests/blackcore/testreaders/testreaders.cpp index 63c51b0118..652c68b58c 100644 --- a/tests/blackcore/testreaders/testreaders.cpp +++ b/tests/blackcore/testreaders/testreaders.cpp @@ -37,7 +37,7 @@ using namespace BlackCore::Db; namespace BlackCoreTest { - //! Test data readers (for bookings, JSON, etc.) + //! Test data readers (for ICAOs, JSON, etc.) class CTestReaders : public QObject { Q_OBJECT