diff --git a/src/blackconfig/buildconfig.cpp b/src/blackconfig/buildconfig.cpp index 13e2c3aa1..19f2df5d8 100644 --- a/src/blackconfig/buildconfig.cpp +++ b/src/blackconfig/buildconfig.cpp @@ -270,9 +270,9 @@ namespace BlackConfig bool ok; const long long btsll = bts.toLongLong(&ok); // at least 64bit if (!ok) { return 0; } - // now we have to converto int + // now we have to convert to int, otherwise we would fail 2021 // max 2147483647 (2^31 - 1) - // 1MMddHHmm (years since 2010) + // yyMMddHHmm (years since 2010) // yyyyMMddHHmm const long long yearOffset = 201000000000; const int btsInt = btsll - yearOffset; diff --git a/src/blackcore/airspacemonitor.cpp b/src/blackcore/airspacemonitor.cpp index 7b3f40ee3..7c73861b8 100644 --- a/src/blackcore/airspacemonitor.cpp +++ b/src/blackcore/airspacemonitor.cpp @@ -73,7 +73,7 @@ namespace BlackCore m_analyzer(new CAirspaceAnalyzer(ownAircraftProvider, this, network, this)) { this->setObjectName("CAirspaceMonitor"); - m_enableReverseLookupMsgs = sApp->isRunningInDeveloperEnvironment(); + m_enableReverseLookupMsgs = sApp->isDeveloperFlagSet(); connect(m_network, &INetwork::atcPositionUpdate, this, &CAirspaceMonitor::onAtcPositionUpdate); connect(m_network, &INetwork::atisReplyReceived, this, &CAirspaceMonitor::onAtisReceived); diff --git a/src/blackcore/application.cpp b/src/blackcore/application.cpp index 8ee118122..f3b5f2d17 100644 --- a/src/blackcore/application.cpp +++ b/src/blackcore/application.cpp @@ -472,12 +472,12 @@ namespace BlackCore const QString &CApplication::versionStringDetailed() const { - if (this->isRunningInDeveloperEnvironment() && CBuildConfig::isLocalDeveloperDebugBuild()) + if (this->isDeveloperFlagSet() && CBuildConfig::isLocalDeveloperDebugBuild()) { static const QString s(CBuildConfig::getVersionString() + " [dev,DEVDBG]"); return s; } - if (isRunningInDeveloperEnvironment()) + if (isDeveloperFlagSet()) { static const QString s(CBuildConfig::getVersionString() + " [dev]"); return s; @@ -504,12 +504,17 @@ namespace BlackCore bool CApplication::initIsRunningInDeveloperEnvironment() const { + // // assumption: restricted distributions are development versions + // if (this->getApplicationInfo().isSampleOrUnitTest()) { return true; } + if (CBuildConfig::isLocalDeveloperDebugBuild()) { return true; } + const CDistribution d(this->getOwnDistribution()); - const bool canSetDeveloperEnv = CBuildConfig::isLocalDeveloperDebugBuild() || d.isRestricted(); - if (canSetDeveloperEnv && this->isSet(m_cmdDevelopment)) { return true; } + if (d.isRestricted() && this->isSet(m_cmdDevelopment)) { return true; } + + // we can globally set a dev.flag if (this->isSetupAvailable()) { // assume value from setup @@ -560,7 +565,7 @@ namespace BlackCore boolToYesNo(CBuildConfig::isLocalDeveloperDebugBuild()) % separator % QStringLiteral("dev.env.: ") % - boolToYesNo(this->isRunningInDeveloperEnvironment()) % + boolToYesNo(this->isDeveloperFlagSet()) % separator % QStringLiteral("distribution: ") % this->getOwnDistribution().toQString(true) % @@ -1208,7 +1213,7 @@ namespace BlackCore } // dev. - m_devEnv = this->initIsRunningInDeveloperEnvironment(); + m_devFlag = this->initIsRunningInDeveloperEnvironment(); // Hookin, other parsing if (!this->parsingHookIn()) { return false; } diff --git a/src/blackcore/application.h b/src/blackcore/application.h index d075cdc19..22801e24d 100644 --- a/src/blackcore/application.h +++ b/src/blackcore/application.h @@ -155,7 +155,7 @@ namespace BlackCore //! Global setup //! \threadsafe - BlackCore::Data::CGlobalSetup getGlobalSetup() const; + Data::CGlobalSetup getGlobalSetup() const; //! Update info //! \threadsafe @@ -177,8 +177,8 @@ namespace BlackCore //! swift info string const char *swiftVersionChar(); - //! Running in dev.environment? - bool isRunningInDeveloperEnvironment() const { return m_devEnv; } + //! Running with dev.flag? + bool isDeveloperFlagSet() const { return m_devFlag; } //! Signal startup automatically or individually void setSignalStartupAutomatically(bool enabled) { m_signalStartup = enabled; } @@ -316,7 +316,7 @@ namespace BlackCore //! Init web data services and start them //! \sa webDataServicesStarted //! \remark requires setup loaded - BlackMisc::CStatusMessageList useWebDataServices(const CWebReaderFlags::WebReader webReader, const BlackCore::Db::CDatabaseReaderConfigList &dbReaderConfig); + BlackMisc::CStatusMessageList useWebDataServices(const CWebReaderFlags::WebReader webReader, const Db::CDatabaseReaderConfigList &dbReaderConfig); //! Get the facade CCoreFacade *getCoreFacade() { return m_coreFacade.data(); } @@ -361,7 +361,7 @@ namespace BlackCore //! Access to setup reader //! \remark supposed to be used only in special cases - BlackCore::CSetupReader *getSetupReader() const; + CSetupReader *getSetupReader() const; //! Setup already synchronized bool isSetupAvailable() const; @@ -615,7 +615,7 @@ namespace BlackCore bool m_useContexts = false; //!< use contexts bool m_useWebData = false; //!< use web data bool m_signalStartup = true; //!< signal startup automatically - bool m_devEnv = false; //!< dev. environment + bool m_devFlag = false; //!< dev. environment bool m_saveSettingsOnShutdown = true; //!< saving all settings on shutdown // -------------- crashpad ----------------- @@ -625,7 +625,7 @@ namespace BlackCore #ifdef BLACK_USE_CRASHPAD std::unique_ptr m_crashpadClient; std::unique_ptr m_crashReportDatabase; - BlackMisc::CSettingReadOnly m_crashDumpUploadEnabled { this, &CApplication::crashDumpUploadEnabledChanged }; + BlackMisc::CSettingReadOnly m_crashDumpUploadEnabled { this, &CApplication::crashDumpUploadEnabledChanged }; #endif }; } // namespace diff --git a/src/blackcore/context/contextsimulator.h b/src/blackcore/context/contextsimulator.h index be1458dd6..dc3d7af13 100644 --- a/src/blackcore/context/contextsimulator.h +++ b/src/blackcore/context/contextsimulator.h @@ -89,7 +89,7 @@ namespace BlackCore void simulatorStatusChanged(int status); //! Simulator plugin loaded / unloaded (default info) - void simulatorPluginChanged(BlackMisc::Simulation::CSimulatorPluginInfo info); + void simulatorPluginChanged(const BlackMisc::Simulation::CSimulatorPluginInfo &info); //! Render restrictions have been changed void renderRestrictionsChanged(bool restricted, bool enabled, int maxAircraft, const BlackMisc::PhysicalQuantities::CLength &maxRenderedDistance); diff --git a/src/blackcore/context/contextsimulatorimpl.cpp b/src/blackcore/context/contextsimulatorimpl.cpp index fd22c3e24..4fc2d397a 100644 --- a/src/blackcore/context/contextsimulatorimpl.cpp +++ b/src/blackcore/context/contextsimulatorimpl.cpp @@ -58,7 +58,7 @@ namespace BlackCore this->setObjectName("CContextSimulator"); CContextSimulator::registerHelp(); - m_enableMatchingMessages = sApp->isRunningInDeveloperEnvironment(); + m_enableMatchingMessages = sApp->isDeveloperFlagSet(); m_plugins->collectPlugins(); this->restoreSimulatorPlugins(); diff --git a/src/blackgui/components/aircraftpartshistory.cpp b/src/blackgui/components/aircraftpartshistory.cpp index 446f23240..df7e48a12 100644 --- a/src/blackgui/components/aircraftpartshistory.cpp +++ b/src/blackgui/components/aircraftpartshistory.cpp @@ -35,7 +35,7 @@ namespace BlackGui ui(new Ui::CAircraftPartsHistory) { ui->setupUi(this); - ui->cb_PartsHistoryEnabled->setChecked(sApp && sApp->isRunningInDeveloperEnvironment()); // default + ui->cb_PartsHistoryEnabled->setChecked(sApp && sApp->isDeveloperFlagSet()); // default m_timerUpdateHistory.setInterval(2 * 1000); this->initGui(); diff --git a/src/blackgui/components/dbdebugdatabasesetup.cpp b/src/blackgui/components/dbdebugdatabasesetup.cpp index dde74d505..616c50e88 100644 --- a/src/blackgui/components/dbdebugdatabasesetup.cpp +++ b/src/blackgui/components/dbdebugdatabasesetup.cpp @@ -26,7 +26,7 @@ namespace BlackGui ui(new Ui::CDbDebugDatabaseSetup) { ui->setupUi(this); - const bool enabled = sGui->isRunningInDeveloperEnvironment(); + const bool enabled = sGui->isDeveloperFlagSet(); this->setEnabled(enabled); if (!enabled) { diff --git a/src/blackgui/components/dblogincomponent.cpp b/src/blackgui/components/dblogincomponent.cpp index ba8852dd3..6af12b4fe 100644 --- a/src/blackgui/components/dblogincomponent.cpp +++ b/src/blackgui/components/dblogincomponent.cpp @@ -54,7 +54,7 @@ namespace BlackGui ui->tbr_InfoAndHints->setHtml(html); ui->tbr_InfoAndHints->setOpenExternalLinks(true); - const bool devEnv = sGui->isRunningInDeveloperEnvironment(); + const bool devEnv = sGui->isDeveloperFlagSet(); ui->comp_DebugSetup->setVisible(devEnv); const QString dbUrl = sGui->getGlobalSetup().getDbHomePageUrl().toQString(); diff --git a/src/blackgui/components/dbusserveraddressselector.cpp b/src/blackgui/components/dbusserveraddressselector.cpp index f86e96fd3..0097614ec 100644 --- a/src/blackgui/components/dbusserveraddressselector.cpp +++ b/src/blackgui/components/dbusserveraddressselector.cpp @@ -32,7 +32,7 @@ namespace BlackGui ui->setupUi(this); // normally no system Bus on Windows - if (CBuildConfig::isRunningOnWindowsNtPlatform() || !sGui->isRunningInDeveloperEnvironment()) + if (CBuildConfig::isRunningOnWindowsNtPlatform() || !sGui->isDeveloperFlagSet()) { this->setSystemDBusVisible(false); } diff --git a/src/blackgui/components/logincomponent.cpp b/src/blackgui/components/logincomponent.cpp index adcf49cbc..65e812d8d 100644 --- a/src/blackgui/components/logincomponent.cpp +++ b/src/blackgui/components/logincomponent.cpp @@ -147,7 +147,7 @@ namespace BlackGui CServerList otherServers(m_otherTrafficNetworkServers.getThreadLocal()); // add a testserver when no servers can be loaded - if (otherServers.isEmpty() && (sGui->isRunningInDeveloperEnvironment() || CBuildConfig::isLocalDeveloperDebugBuild())) + if (otherServers.isEmpty() && (sGui->isDeveloperFlagSet() || CBuildConfig::isLocalDeveloperDebugBuild())) { otherServers.push_back(sGui->getGlobalSetup().getFsdTestServersPlusHardcodedServers()); CLogMessage(this).info("Added servers for testing"); diff --git a/src/blackgui/components/settingscomponent.cpp b/src/blackgui/components/settingscomponent.cpp index 4a077ea93..d7849d972 100644 --- a/src/blackgui/components/settingscomponent.cpp +++ b/src/blackgui/components/settingscomponent.cpp @@ -47,7 +47,7 @@ namespace BlackGui this->tabBar()->setExpanding(false); this->tabBar()->setUsesScrollButtons(true); this->setCurrentIndex(0); // 1st tab - ui->comp_DataLoadOverview->showVisibleDbRefreshButtons(CBuildConfig::isDebugBuild() || sGui->isRunningInDeveloperEnvironment()); + ui->comp_DataLoadOverview->showVisibleDbRefreshButtons(CBuildConfig::isDebugBuild() || sGui->isDeveloperFlagSet()); ui->comp_DataLoadOverview->showVisibleLoadAllButtons(false, false); connect(ui->comp_SettingsGuiGeneral, &CSettingsGuiComponent::changedWindowsOpacity, this, &CSettingsComponent::changedWindowsOpacity); diff --git a/src/blackgui/components/settingsnetworkserverscomponent.cpp b/src/blackgui/components/settingsnetworkserverscomponent.cpp index a4eaa8c97..e43284cd3 100644 --- a/src/blackgui/components/settingsnetworkserverscomponent.cpp +++ b/src/blackgui/components/settingsnetworkserverscomponent.cpp @@ -60,7 +60,7 @@ namespace BlackGui // add swift test servers in case we have no servers: // this is debug/bootstrap feature we can continue to test when something goes wrong - if (serverList.isEmpty() && (sGui->isRunningInDeveloperEnvironment())) + if (serverList.isEmpty() && (sGui->isDeveloperFlagSet())) { serverList.push_back(sGui->getGlobalSetup().getFsdTestServersPlusHardcodedServers()); } diff --git a/src/blackgui/loginmodebuttons.cpp b/src/blackgui/loginmodebuttons.cpp index 33193a844..681e629b1 100644 --- a/src/blackgui/loginmodebuttons.cpp +++ b/src/blackgui/loginmodebuttons.cpp @@ -74,7 +74,7 @@ namespace BlackGui void CLoginModeButtons::configureLoginModes() { - if (!sGui->isRunningInDeveloperEnvironment() && !sGui->getIContextSimulator()->isSimulatorSimulating()) + if (!sGui->isDeveloperFlagSet() && !sGui->getIContextSimulator()->isSimulatorSimulating()) { // Disable pilot login modes ui->rb_LoginNormal->setEnabled(false); diff --git a/src/plugins/simulator/emulated/simulatoremulated.cpp b/src/plugins/simulator/emulated/simulatoremulated.cpp index f7642332f..7dbae374a 100644 --- a/src/plugins/simulator/emulated/simulatoremulated.cpp +++ b/src/plugins/simulator/emulated/simulatoremulated.cpp @@ -422,7 +422,7 @@ namespace BlackSimPlugin { const CCallsign cs = aircraft.getCallsign(); if (!m_interpolators.contains(cs)) { continue; } - const bool log = setup.logCallsign(cs); + const bool log = setup.isLogCallsign(cs); CInterpolatorMulti *im = m_interpolators[cs]; CInterpolationStatus statusInterpolation; CPartsStatus statusParts; diff --git a/src/swiftdata/swiftdatamenus.cpp b/src/swiftdata/swiftdatamenus.cpp index f5472d9ea..e6234bbd2 100644 --- a/src/swiftdata/swiftdatamenus.cpp +++ b/src/swiftdata/swiftdatamenus.cpp @@ -62,7 +62,7 @@ void CSwiftData::initDynamicMenus() Q_ASSERT_X(ui->comp_MainInfoArea->getDataInfoAreaComponent(), Q_FUNC_INFO, "Missing DB info area"); ui->menu_Mapping->addAction(CIcons::database16(), "Load all DB data", ui->comp_MainInfoArea->getDataInfoAreaComponent(), SLOT(requestUpdateOfAllDbData())); ui->menu_Mapping->addAction(CIcons::load16(), "Load DB test data from disk", ui->comp_MainInfoArea->getDataInfoAreaComponent(), SLOT(readDbDataFromResourceDir())); - if (sGui->isRunningInDeveloperEnvironment()) + if (sGui->isDeveloperFlagSet()) { ui->menu_Mapping->addAction(CIcons::save16(), "Save DB test data to disk", ui->comp_MainInfoArea->getDataInfoAreaComponent(), SLOT(writeDbDataToResourceDir())); }