diff --git a/src/blackcore/data/globalsetup.cpp b/src/blackcore/data/globalsetup.cpp index 51c77a7bc..dbd20d29b 100644 --- a/src/blackcore/data/globalsetup.cpp +++ b/src/blackcore/data/globalsetup.cpp @@ -310,40 +310,24 @@ namespace BlackCore const ColumnIndex i = index.frontCasted(); switch (i) { - case IndexDbRootDirectory: - return CVariant::fromValue(this->m_dbRootDirectoryUrl); - case IndexDbHttpPort: - return CVariant::fromValue(this->m_dbHttpPort); - case IndexDbHttpsPort: - return CVariant::fromValue(this->m_dbHttpsPort); - case IndexDbLoginService: - return CVariant::fromValue(this->getDbLoginServiceUrl()); - case IndexVatsimStatus: - return CVariant::fromValue(this->m_vatsimStatusFileUrls); - case IndexVatsimData: - return CVariant::fromValue(this->m_vatsimDataFileUrls); - case IndexVatsimBookings: - return CVariant::fromValue(this->m_vatsimDataFileUrls); - case IndexVatsimMetars: - return CVariant::fromValue(this->m_vatsimMetarsUrls); - case IndexBootstrapFileUrls: - return CVariant::fromValue(this->getSwiftBootstrapFileUrls()); - case IndexDistributionFileUrls: - return CVariant::fromValue(this->getSwiftDistributionFileUrls()); - case IndexSharedUrls: - return CVariant::fromValue(this->m_sharedUrls); - case IndexNewsUrls: - return CVariant::fromValue(this->m_newsUrls); - case IndexSwiftMapUrls: - return CVariant::fromValue(this->m_mapUrls); - case IndexOnlineHelpUrls: - return CVariant::fromValue(this->m_onlineHelpUrls); - case IndexCrashReportServerUrl: - return CVariant::fromValue(this->m_crashReportServerUrl); - case IndexWasLoaded: - return CVariant::fromValue(this->m_wasLoaded); - default: - return CValueObject::propertyByIndex(index); + case IndexDbRootDirectory: return CVariant::fromValue(this->m_dbRootDirectoryUrl); + case IndexDbHttpPort: return CVariant::fromValue(this->m_dbHttpPort); + case IndexDbHttpsPort: return CVariant::fromValue(this->m_dbHttpsPort); + case IndexDbLoginService: return CVariant::fromValue(this->getDbLoginServiceUrl()); + case IndexDbClientPingService: return CVariant::fromValue(this->getDbClientPingServiceUrl()); + case IndexVatsimStatus: return CVariant::fromValue(this->m_vatsimStatusFileUrls); + case IndexVatsimData: return CVariant::fromValue(this->m_vatsimDataFileUrls); + case IndexVatsimBookings: return CVariant::fromValue(this->m_vatsimDataFileUrls); + case IndexVatsimMetars: return CVariant::fromValue(this->m_vatsimMetarsUrls); + case IndexBootstrapFileUrls: return CVariant::fromValue(this->getSwiftBootstrapFileUrls()); + case IndexDistributionFileUrls: return CVariant::fromValue(this->getSwiftDistributionFileUrls()); + case IndexSharedUrls: return CVariant::fromValue(this->m_sharedUrls); + case IndexNewsUrls: return CVariant::fromValue(this->m_newsUrls); + case IndexSwiftMapUrls: return CVariant::fromValue(this->m_mapUrls); + case IndexOnlineHelpUrls: return CVariant::fromValue(this->m_onlineHelpUrls); + case IndexCrashReportServerUrl: return CVariant::fromValue(this->m_crashReportServerUrl); + case IndexWasLoaded: return CVariant::fromValue(this->m_wasLoaded); + default: return CValueObject::propertyByIndex(index); } } @@ -359,47 +343,21 @@ namespace BlackCore const ColumnIndex i = index.frontCasted(); switch (i) { - case IndexDbRootDirectory: - this->m_dbRootDirectoryUrl.setPropertyByIndex(index.copyFrontRemoved(), variant); - break; - case IndexDbHttpPort: - this->m_dbHttpPort = variant.toInt(); - break; - case IndexDbHttpsPort: - this->m_dbHttpsPort = variant.toInt(); - break; - case IndexDbLoginService: - break; - case IndexVatsimData: - this->m_vatsimDataFileUrls = variant.value(); - break; - case IndexVatsimBookings: - this->m_vatsimBookingsUrl.setPropertyByIndex(index.copyFrontRemoved(), variant); - break; - case IndexVatsimMetars: - this->m_vatsimMetarsUrls = variant.value(); - break; - case IndexSharedUrls: - this->m_sharedUrls = variant.value(); - break; - case IndexNewsUrls: - this->m_newsUrls = variant.value(); - break; - case IndexOnlineHelpUrls: - this->m_onlineHelpUrls = variant.value(); - break; - case IndexSwiftMapUrls: - this->m_mapUrls = variant.value(); - break; - case IndexCrashReportServerUrl: - this->m_crashReportServerUrl = variant.value(); - break; - case IndexWasLoaded: - this->m_wasLoaded = variant.toBool(); - break; - default: - CValueObject::setPropertyByIndex(index, variant); - break; + case IndexDbRootDirectory: this->m_dbRootDirectoryUrl.setPropertyByIndex(index.copyFrontRemoved(), variant); break; + case IndexDbHttpPort: this->m_dbHttpPort = variant.toInt(); break; + case IndexDbHttpsPort: this->m_dbHttpsPort = variant.toInt(); break; + case IndexDbLoginService: break; // cannot be changed + case IndexDbClientPingService: break; // cannot be changed + case IndexVatsimData: this->m_vatsimDataFileUrls = variant.value(); break; + case IndexVatsimBookings: this->m_vatsimBookingsUrl.setPropertyByIndex(index.copyFrontRemoved(), variant); break; + case IndexVatsimMetars: this->m_vatsimMetarsUrls = variant.value(); break; + case IndexSharedUrls: this->m_sharedUrls = variant.value(); break; + case IndexNewsUrls: this->m_newsUrls = variant.value(); break; + case IndexOnlineHelpUrls: this->m_onlineHelpUrls = variant.value(); break; + case IndexSwiftMapUrls: this->m_mapUrls = variant.value(); break; + case IndexCrashReportServerUrl: this->m_crashReportServerUrl = variant.value(); break; + case IndexWasLoaded: this->m_wasLoaded = variant.toBool(); break; + default: CValueObject::setPropertyByIndex(index, variant); break; } } diff --git a/src/blackcore/db/networkwatchdog.cpp b/src/blackcore/db/networkwatchdog.cpp index 2f7814ad2..206d2848a 100644 --- a/src/blackcore/db/networkwatchdog.cpp +++ b/src/blackcore/db/networkwatchdog.cpp @@ -35,9 +35,9 @@ namespace BlackCore connect(&m_updateTimer, &QTimer::timeout, this, &CNetworkWatchdog::doWork); } - void CNetworkWatchdog::setDbAccessibility(bool available) + void CNetworkWatchdog::setDbAccessibility(bool accessible) { - m_dbAccessible = available; + m_dbAccessible = accessible; m_internetAccessible = m_internetAccessible && m_networkAccessible; QTimer::singleShot(0, &m_updateTimer, [this] { this->m_updateTimer.start(); }); // restart } @@ -52,7 +52,7 @@ namespace BlackCore int CNetworkWatchdog::triggerCheck() { if (!this->doWorkCheck()) return false; // senseless - if (m_checkInProgress) return -1; + if (m_checkInProgress) { return -1; } const int n = this->getCheckCount(); QTimer::singleShot(0, this, &CNetworkWatchdog::doWork); diff --git a/src/blackcore/db/networkwatchdog.h b/src/blackcore/db/networkwatchdog.h index 8f358627e..0129108ff 100644 --- a/src/blackcore/db/networkwatchdog.h +++ b/src/blackcore/db/networkwatchdog.h @@ -40,7 +40,7 @@ namespace BlackCore //! Set DB as avialable (from external) //! \remark if data was read from DB, this can save another check //! \threadsafe - void setDbAccessibility(bool available); + void setDbAccessibility(bool accessible); //! DB is accessible //! \threadsafe diff --git a/src/blackmisc/identifier.cpp b/src/blackmisc/identifier.cpp index 0e5c78685..9b98a9bd1 100644 --- a/src/blackmisc/identifier.cpp +++ b/src/blackmisc/identifier.cpp @@ -107,31 +107,21 @@ namespace BlackMisc { if (index.isMyself()) { return CVariant::from(*this); } - ColumnIndex i = index.frontCasted(); + const ColumnIndex i = index.frontCasted(); if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); } switch (i) { - case IndexName: - return CVariant::fromValue(m_name); - case IndexMachineIdBase64: - return CVariant::fromValue(m_machineIdBase64); - case IndexMachineName: - return CVariant::fromValue(getMachineName()); - case IndexMachineId: - return CVariant::fromValue(getMachineId()); - case IndexProcessId: - return CVariant::fromValue(m_processId); - case IndexProcessName: - return CVariant::fromValue(m_processName); - case IndexIsFromLocalMachine: - return CVariant::fromValue(isFromLocalMachine()); - case IndexIsFromSameProcess: - return CVariant::fromValue(isFromSameProcess()); - case IndexIsFromSameProcessName: - return CVariant::fromValue(isFromSameProcessName()); - default: - return CValueObject::propertyByIndex(index); + case IndexName: return CVariant::fromValue(m_name); + case IndexMachineIdBase64: return CVariant::fromValue(m_machineIdBase64); + case IndexMachineName: return CVariant::fromValue(getMachineName()); + case IndexMachineId: return CVariant::fromValue(getMachineId()); + case IndexProcessId: return CVariant::fromValue(m_processId); + case IndexProcessName: return CVariant::fromValue(m_processName); + case IndexIsFromLocalMachine: return CVariant::fromValue(isFromLocalMachine()); + case IndexIsFromSameProcess: return CVariant::fromValue(isFromSameProcess()); + case IndexIsFromSameProcessName: return CVariant::fromValue(isFromSameProcessName()); + default: return CValueObject::propertyByIndex(index); } } diff --git a/src/blackmisc/worker.h b/src/blackmisc/worker.h index 431330556..0e95d7054 100644 --- a/src/blackmisc/worker.h +++ b/src/blackmisc/worker.h @@ -410,7 +410,6 @@ namespace BlackMisc QPointer m_weak; CConnectionGuard m_guard; }; - } #endif