diff --git a/.clang-tidy b/.clang-tidy index e7c970cae..075b1d3a4 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -46,6 +46,7 @@ Checks: > readability-use-anyofallof, readability-redundant-member-init, cppcoreguidelines-init-variables, + readability-static-accessed-through-instance, CheckOptions: - key: readability-identifier-naming.ClassCase diff --git a/src/core/application.cpp b/src/core/application.cpp index bbd0ab7b4..996151556 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -838,7 +838,7 @@ namespace swift::core { const CStatusMessage m = this->supportsContexts() ? this->getIContextApplication()->saveSettings() : CSettingsCache::instance()->saveToStore(); - CLogMessage(this).preformatted(m); + CLogMessage::preformatted(m); } // from here on we really rip apart the application object @@ -870,7 +870,7 @@ namespace swift::core // clean up all in "deferred delete state" qApp->sendPostedEvents(nullptr, QEvent::DeferredDelete); - sApp->processEventsFor(500); + processEventsFor(500); // completed m_shutdown = true; diff --git a/src/core/context/contextownaircraftimpl.cpp b/src/core/context/contextownaircraftimpl.cpp index a00a74c4b..4dff42282 100644 --- a/src/core/context/contextownaircraftimpl.cpp +++ b/src/core/context/contextownaircraftimpl.cpp @@ -142,7 +142,7 @@ namespace swift::core::context ownAircraft.setPilot(m_currentNetworkServer.get().getUser()); // If we already have a model from somehwere, keep it, otherwise init default - ownAircraft.setModel(this->reverseLookupModel(ownAircraft.getModel())); + ownAircraft.setModel(reverseLookupModel(ownAircraft.getModel())); if (!ownAircraft.getAircraftIcaoCode().hasValidDesignator()) { ownAircraft.setModel(getDefaultOwnAircraftModel()); @@ -205,7 +205,7 @@ namespace swift::core::context bool CContextOwnAircraft::updateOwnModel(const CAircraftModel &model, const CIdentifier &identifier) { - CAircraftModel updateModel(this->reverseLookupModel(model)); + CAircraftModel updateModel(reverseLookupModel(model)); { QWriteLocker l(&m_lockAircraft); const bool changed = (m_ownAircraft.getModel() != updateModel); diff --git a/src/core/db/databaseutils.cpp b/src/core/db/databaseutils.cpp index a1c06c262..cf53239cd 100644 --- a/src/core/db/databaseutils.cpp +++ b/src/core/db/databaseutils.cpp @@ -179,7 +179,7 @@ namespace swift::core::db if (processEvents && c % 125 == 0) { if (!sApp || sApp->isShuttingDown()) { return models; } - sApp->processEventsFor(25); + CApplication::processEventsFor(25); } const QString ms(model.getModelString()); @@ -222,7 +222,7 @@ namespace swift::core::db if (processEvents && c % 125 == 0) { if (!sApp || sApp->isShuttingDown()) { return models; } - sApp->processEventsFor(25); + CApplication::processEventsFor(25); } const QString ms(model.getModelString()); @@ -268,7 +268,7 @@ namespace swift::core::db if (modified || model.hasValidDbKey()) { c++; - if (processEvents && c % 125 == 0) { sApp->processEventsFor(25); } + if (processEvents && c % 125 == 0) { CApplication::processEventsFor(25); } } } CLogMessage(static_cast(nullptr)).info(u"Consolidated %1 models in %2ms") @@ -374,7 +374,7 @@ namespace swift::core::db const int percentage = c * 100 / maxModelsCount; progressIndicator->updateProgressIndicatorAndProcessEvents(percentage); } - else { sApp->processEventsFor(10); } + else { CApplication::processEventsFor(10); } } // values to be skipped diff --git a/src/gui/components/audionotificationcomponent.cpp b/src/gui/components/audionotificationcomponent.cpp index 933797b42..12ae5867a 100644 --- a/src/gui/components/audionotificationcomponent.cpp +++ b/src/gui/components/audionotificationcomponent.cpp @@ -199,7 +199,7 @@ namespace swift::gui::components ui->cb_SetupAudioNotificationLogoff->isChecked()); const CStatusMessage msg = m_audioSettings.set(as); - CLogMessage(this).preformatted(msg); + CLogMessage::preformatted(msg); const auto *sender = qobject_cast(QObject::sender()); if (checked && sGui && sGui->getCContextAudioBase() && sender) diff --git a/src/gui/components/copymodelsfromotherswiftversionscomponent.cpp b/src/gui/components/copymodelsfromotherswiftversionscomponent.cpp index 539709648..f62468841 100644 --- a/src/gui/components/copymodelsfromotherswiftversionscomponent.cpp +++ b/src/gui/components/copymodelsfromotherswiftversionscomponent.cpp @@ -175,7 +175,7 @@ namespace swift::gui::components if (ui->cb_Silent->isChecked()) { // allow UI updates - sApp->processEventsFor(50); + CApplication::processEventsFor(50); return true; } const QMessageBox::StandardButton reply = QMessageBox::question( diff --git a/src/gui/components/dbloadoverviewcomponent.cpp b/src/gui/components/dbloadoverviewcomponent.cpp index eb935263b..948f99cd5 100644 --- a/src/gui/components/dbloadoverviewcomponent.cpp +++ b/src/gui/components/dbloadoverviewcomponent.cpp @@ -31,7 +31,7 @@ namespace swift::gui::components //! \fixme KB 201709 It is hard to judge if it is a good idea to trigger cache admit in a UI component // althought admit happens in background, this component might trigger cache reads not needed (though it is not // very likely) - this->admitCaches(); + admitCaches(); ui->lbl_DatabaseUrl->setTextFormat(Qt::RichText); ui->lbl_DatabaseUrl->setTextInteractionFlags(Qt::TextBrowserInteraction); diff --git a/src/gui/components/firstmodelsetcomponent.cpp b/src/gui/components/firstmodelsetcomponent.cpp index 49c54b537..38b358d88 100644 --- a/src/gui/components/firstmodelsetcomponent.cpp +++ b/src/gui/components/firstmodelsetcomponent.cpp @@ -298,7 +298,7 @@ namespace swift::gui::components QWidget *CFirstModelSetComponent::mainWindow() { - QWidget *pw = sGui->mainApplicationWidget(); + QWidget *pw = CGuiApplication::mainApplicationWidget(); return pw ? pw : this; } diff --git a/src/gui/components/infobarstatuscomponent.cpp b/src/gui/components/infobarstatuscomponent.cpp index 411b8127e..1aaa281d0 100644 --- a/src/gui/components/infobarstatuscomponent.cpp +++ b/src/gui/components/infobarstatuscomponent.cpp @@ -250,8 +250,8 @@ namespace swift::gui::components void CInfoBarStatusComponent::updateSpacing() { - if (!sGui || sGui->isShuttingDown() || !sGui->mainApplicationWidget()) { return; } - const int w = sGui->mainApplicationWidget()->width(); + if (!sGui || sGui->isShuttingDown() || !CGuiApplication::mainApplicationWidget()) { return; } + const int w = CGuiApplication::mainApplicationWidget()->width(); const int s = (w >= 400) ? 6 : 2; this->setSpacing(s); } diff --git a/src/gui/components/settingshotkeycomponent.cpp b/src/gui/components/settingshotkeycomponent.cpp index 63aaf0494..4ef9627ca 100644 --- a/src/gui/components/settingshotkeycomponent.cpp +++ b/src/gui/components/settingshotkeycomponent.cpp @@ -56,7 +56,7 @@ namespace swift::gui::components void CSettingsHotkeyComponent::saveSettings() { const CStatusMessage msg = m_actionHotkeys.save(); - CLogMessage(this).preformatted(msg); + CLogMessage::preformatted(msg); } void CSettingsHotkeyComponent::registerDummyPttEntry() diff --git a/src/gui/components/settingssimulatorbasicscomponent.cpp b/src/gui/components/settingssimulatorbasicscomponent.cpp index da0967f0a..50b0ac80a 100644 --- a/src/gui/components/settingssimulatorbasicscomponent.cpp +++ b/src/gui/components/settingssimulatorbasicscomponent.cpp @@ -166,8 +166,8 @@ namespace swift::gui::components // override if values are not empty const CSpecializedSimulatorSettings ss = m_settings.getSpecializedSettings(simulator); - const QString sd = CFileUtils::fixWindowsUncPath( - CFileUtils::normalizeFilePathToQtStandard(ss.defaultSimulatorDirectory(simulator))); + const QString sd = CFileUtils::fixWindowsUncPath(CFileUtils::normalizeFilePathToQtStandard( + CSpecializedSimulatorSettings::defaultSimulatorDirectory(simulator))); if (!sd.isEmpty()) { ui->le_SimulatorDirectory->setText(sd); @@ -181,7 +181,7 @@ namespace swift::gui::components m_unsavedChanges = true; } - const QStringList excludes(ss.defaultModelExcludeDirectoryPatterns(simulator)); + const QStringList excludes(CSpecializedSimulatorSettings::defaultModelExcludeDirectoryPatterns(simulator)); if (!excludes.isEmpty()) { this->displayExcludeDirectoryPatterns(excludes); diff --git a/src/gui/components/settingssimulatorcomponent.cpp b/src/gui/components/settingssimulatorcomponent.cpp index c2f4c8c24..cbb65bcf3 100644 --- a/src/gui/components/settingssimulatorcomponent.cpp +++ b/src/gui/components/settingssimulatorcomponent.cpp @@ -222,8 +222,9 @@ namespace swift::gui::components // get initial aircraft to render CInterpolationAndRenderingSetupGlobal setup = sGui->getIContextSimulator()->getInterpolationAndRenderingSetupGlobal(); - const int noRequested = - ui->le_MaxAircraft->text().isEmpty() ? setup.InfiniteAircraft() : ui->le_MaxAircraft->text().toInt(); + const int noRequested = ui->le_MaxAircraft->text().isEmpty() ? + CInterpolationAndRenderingSetupGlobal::InfiniteAircraft() : + ui->le_MaxAircraft->text().toInt(); const int oldValue = setup.getMaxRenderedAircraft(); if (oldValue == noRequested) { return; } @@ -301,7 +302,7 @@ namespace swift::gui::components bool ok = false; CSimulatorSettings settings = CSettingsSimulatorComponent::getSimulatorSettings(ok); if (!ok || !settings.setComIntegrated(ui->cb_ComSync->isChecked())) { return; } - this->setSimulatorSettings(settings); + setSimulatorSettings(settings); } void CSettingsSimulatorComponent::onApplyCGSource() @@ -310,7 +311,7 @@ namespace swift::gui::components const CSimulatorSettings::CGSource source = ui->comp_CGSourceSelector->getValue(); CSimulatorSettings settings = CSettingsSimulatorComponent::getSimulatorSettings(ok); if (!ok || !settings.setCGSource(source)) { return; } - this->setSimulatorSettings(settings); + setSimulatorSettings(settings); } void CSettingsSimulatorComponent::onApplyRecordGnd() @@ -332,7 +333,7 @@ namespace swift::gui::components const bool c1 = settings.setRecordOwnAircraftGnd(ui->cb_RecordOwnGndPositions->isChecked()); const bool c2 = settings.setRecordedGndRadius(radius); if (!c1 && !c2) { return; } - this->setSimulatorSettings(settings); + setSimulatorSettings(settings); } void CSettingsSimulatorComponent::onReload() { this->setGuiValues(); } diff --git a/src/gui/components/updateinfocomponent.cpp b/src/gui/components/updateinfocomponent.cpp index 02f89df92..eadf9d80a 100644 --- a/src/gui/components/updateinfocomponent.cpp +++ b/src/gui/components/updateinfocomponent.cpp @@ -198,7 +198,7 @@ namespace swift::gui::components const QString platform = this->getSelectedOrDefaultPlatform().getPlatformName(); const QStringList settings({ channel, platform }); const CStatusMessage m = m_updateSettings.setAndSave(settings); - if (m.isFailure()) { CLogMessage(this).preformatted(m); } + if (m.isFailure()) { CLogMessage::preformatted(m); } } void CUpdateInfoComponent::channelChanged() { this->uiSelectionChanged(); } diff --git a/src/gui/editors/aircraftpartsform.cpp b/src/gui/editors/aircraftpartsform.cpp index 889d90a8f..f2d98a231 100644 --- a/src/gui/editors/aircraftpartsform.cpp +++ b/src/gui/editors/aircraftpartsform.cpp @@ -75,7 +75,7 @@ namespace swift::gui::editors } catch (const CJsonException &ex) { - CLogMessage(this).preformatted(CStatusMessage::fromJsonException(ex, this, "Parse error")); + CLogMessage::preformatted(CStatusMessage::fromJsonException(ex, this, "Parse error")); return parts; } return parts; diff --git a/src/gui/guiapplication.cpp b/src/gui/guiapplication.cpp index cf971de04..077840b26 100644 --- a/src/gui/guiapplication.cpp +++ b/src/gui/guiapplication.cpp @@ -364,7 +364,7 @@ namespace swift::gui CLogSubscriber logSub(this, [&](const CStatusMessage &message) { // handles an error in restoreGeometry/State const int ret = - QMessageBox::critical(sGui->mainApplicationWidget(), sGui->getApplicationNameAndVersion(), + QMessageBox::critical(mainApplicationWidget(), sGui->getApplicationNameAndVersion(), QStringLiteral("Restoring the window state/geometry failed!\n" "You need to reset the window size (command -%1).\n\n" "Original msg: %2\n\n" diff --git a/src/gui/led.cpp b/src/gui/led.cpp index 3a0186f8b..7229d0031 100644 --- a/src/gui/led.cpp +++ b/src/gui/led.cpp @@ -229,7 +229,7 @@ namespace swift::gui if (resetTimeMs > 0) { QPointer myself(this); - m_resetTimer.singleShot(resetTimeMs, this, [=] { + QTimer::singleShot(resetTimeMs, this, [=] { if (!myself) { return; } this->resetState(); }); @@ -252,7 +252,7 @@ namespace swift::gui void CLedWidget::setTriState(int resetTimeMs) { - if (resetTimeMs > 0) { m_resetTimer.singleShot(resetTimeMs, this, &CLedWidget::resetState); } + if (resetTimeMs > 0) { QTimer::singleShot(resetTimeMs, this, &CLedWidget::resetState); } else { m_resetTimer.stop(); diff --git a/src/gui/textmessagetextedit.cpp b/src/gui/textmessagetextedit.cpp index bf0ed5749..b0bd975bd 100644 --- a/src/gui/textmessagetextedit.cpp +++ b/src/gui/textmessagetextedit.cpp @@ -71,8 +71,7 @@ namespace swift::gui void CTextMessageTextEdit::redrawHtml() { - const QString html( - this->toHtml(m_latestFirst ? m_messages.reversed() : m_messages, m_withSender, m_withRecipient)); + const QString html(toHtml(m_latestFirst ? m_messages.reversed() : m_messages, m_withSender, m_withRecipient)); m_textDocument.setHtml(html); this->moveCursor(m_latestFirst ? QTextCursor::Start : QTextCursor::End); } diff --git a/src/misc/applicationinfo.cpp b/src/misc/applicationinfo.cpp index ee71700f9..732daf110 100644 --- a/src/misc/applicationinfo.cpp +++ b/src/misc/applicationinfo.cpp @@ -206,7 +206,7 @@ namespace swift::misc CApplicationInfo::Application CApplicationInfo::guessApplication() { - const QString a(QCoreApplication::instance()->applicationName().toLower()); + const QString a(QCoreApplication::applicationName().toLower()); if (a.contains("test")) { return CApplicationInfo::UnitTest; } // names like testcore if (a.contains("sample")) { return CApplicationInfo::Sample; } if (a.contains("core")) { return CApplicationInfo::PilotClientCore; } diff --git a/src/misc/aviation/aircrafticaocode.cpp b/src/misc/aviation/aircrafticaocode.cpp index 3dab3aa50..db377f065 100644 --- a/src/misc/aviation/aircrafticaocode.cpp +++ b/src/misc/aviation/aircrafticaocode.cpp @@ -122,7 +122,7 @@ namespace swift::misc::aviation { // actually we would expect all DB data to be valid, however right now // we only check special cases - if (this->getDesignator() == this->getUnassignedDesignator()) { return msg; } // DB ZZZZ + if (this->getDesignator() == getUnassignedDesignator()) { return msg; } // DB ZZZZ } if (!hasKnownDesignator()) diff --git a/src/misc/aviation/flightplan.cpp b/src/misc/aviation/flightplan.cpp index e1313e191..fe48feda1 100644 --- a/src/misc/aviation/flightplan.cpp +++ b/src/misc/aviation/flightplan.cpp @@ -128,13 +128,12 @@ namespace swift::misc::aviation m_isParsed = true; if (m_remarks.isEmpty()) { return; } const QString remarks = m_remarks.toUpper(); - const QString callsign = - CCallsign::unifyCallsign(this->getRemark(remarks, "REG/")); // registration is a callsign + const QString callsign = CCallsign::unifyCallsign(getRemark(remarks, "REG/")); // registration is a callsign if (CCallsign::isValidAircraftCallsign(callsign)) { m_registration = CCallsign(callsign, CCallsign::Aircraft); } m_voiceCapabilities = m_voiceCapabilities.isUnknown() ? CVoiceCapabilities(m_remarks) : m_voiceCapabilities; m_flightOperator = - this->getRemark(remarks, "OPR/"); // operator, e.g. British airways, sometimes people use ICAO code here - m_selcalCode = CSelcal(this->getRemark(remarks, "SEL/")); + getRemark(remarks, "OPR/"); // operator, e.g. British airways, sometimes people use ICAO code here + m_selcalCode = CSelcal(getRemark(remarks, "SEL/")); m_radioTelephony = getRemark(remarks, "CALLSIGN/"); // used similar to radio telephony if (m_radioTelephony.isEmpty()) { m_radioTelephony = getRemark(remarks, "RT/"); } if (!m_flightOperator.isEmpty() && CAirlineIcaoCode::isValidAirlineDesignator(m_flightOperator)) diff --git a/src/misc/datacache.cpp b/src/misc/datacache.cpp index 6167ba02c..36fbe0c6d 100644 --- a/src/misc/datacache.cpp +++ b/src/misc/datacache.cpp @@ -262,7 +262,7 @@ namespace swift::misc m_revisionFileName(revisionFileName) {} - const QString &CDataCacheSerializer::persistentStore() const { return m_cache->persistentStore(); } + const QString &CDataCacheSerializer::persistentStore() const { return CDataCache::persistentStore(); } void CDataCacheSerializer::saveToStore(const swift::misc::CVariantMap &values, const swift::misc::CValueCachePacket &baseline) diff --git a/src/misc/dbusserver.cpp b/src/misc/dbusserver.cpp index 4cc419711..496b3b505 100644 --- a/src/misc/dbusserver.cpp +++ b/src/misc/dbusserver.cpp @@ -211,12 +211,12 @@ namespace swift::misc if (ok) { CLogMessage(this).info(u"Adding '%1' to the new connection '%2'") - << key << this->getDBusInterfaceFromClassInfo(i.value()); + << key << getDBusInterfaceFromClassInfo(i.value()); } else { CLogMessage(this).info(u"Adding '%1' failed, connection '%2', error '%3'") - << key << this->getDBusInterfaceFromClassInfo(i.value()) << connection.lastError().message(); + << key << getDBusInterfaceFromClassInfo(i.value()) << connection.lastError().message(); success = false; } } diff --git a/src/misc/simulation/aircraftmodel.cpp b/src/misc/simulation/aircraftmodel.cpp index eb23812d4..78685515e 100644 --- a/src/misc/simulation/aircraftmodel.cpp +++ b/src/misc/simulation/aircraftmodel.cpp @@ -132,6 +132,7 @@ namespace swift::misc::simulation QJsonObject CAircraftModel::toMemoizedJson(MemoHelper::CMemoizer &helper) const { QJsonObject json; + // NOLINTBEGIN(readability-static-accessed-through-instance) introspect().forEachMember([&, this](auto member) { if constexpr (!decltype(member)::has(MetaFlags())) { @@ -139,11 +140,13 @@ namespace swift::misc::simulation json << std::make_pair(CExplicitLatin1String(member.latin1Name()), std::cref(maybeMemo)); } }); + // NOLINTEND(readability-static-accessed-through-instance) return json; } void CAircraftModel::convertFromMemoizedJson(const QJsonObject &json, const MemoHelper::CUnmemoizer &helper) { + // NOLINTBEGIN(readability-static-accessed-through-instance) introspect().forEachMember([&, this](auto member) { if constexpr (!decltype(member)::has(MetaFlags())) { @@ -151,6 +154,7 @@ namespace swift::misc::simulation if (it != json.end()) { it.value() >> helper.maybeUnmemoize(member.in(*this)).get(); } } }); + // NOLINTEND(readability-static-accessed-through-instance) } QString CAircraftModel::asHtmlSummary(const QString &separator) const diff --git a/src/plugins/simulator/emulated/simulatoremulated.cpp b/src/plugins/simulator/emulated/simulatoremulated.cpp index b7aeedef1..85c2cb4c9 100644 --- a/src/plugins/simulator/emulated/simulatoremulated.cpp +++ b/src/plugins/simulator/emulated/simulatoremulated.cpp @@ -38,7 +38,7 @@ namespace swift::simplugin::emulated this->onSettingsChanged(); // init from settings m_myAircraft = this->getOwnAircraft(); // sync with provider - m_monitorWidget = new CSimulatorEmulatedMonitorDialog(this, sGui->mainApplicationWidget()); + m_monitorWidget = new CSimulatorEmulatedMonitorDialog(this, CGuiApplication::mainApplicationWidget()); connect(qApp, &QApplication::aboutToQuit, this, &CSimulatorEmulated::closeMonitor); connect(sGui, &CGuiApplication::aboutToShutdown, this, &CSimulatorEmulated::closeMonitor, Qt::QueuedConnection); diff --git a/src/plugins/simulator/flightgear/simulatorflightgear.cpp b/src/plugins/simulator/flightgear/simulatorflightgear.cpp index 25d1b58b4..8f7f0e9e0 100644 --- a/src/plugins/simulator/flightgear/simulatorflightgear.cpp +++ b/src/plugins/simulator/flightgear/simulatorflightgear.cpp @@ -386,7 +386,7 @@ namespace swift::simplugin::flightgear if (!m_serviceProxy) { return; } CLogMessage(this).info(u"FG DBus service unregistered"); - if (m_dbusMode == P2P) { m_dBusConnection.disconnectFromPeer(m_dBusConnection.name()); } + if (m_dbusMode == P2P) { QDBusConnection::disconnectFromPeer(m_dBusConnection.name()); } m_dBusConnection = QDBusConnection { "default" }; if (m_watcher) { m_watcher->setConnection(m_dBusConnection); } delete m_serviceProxy; @@ -1043,11 +1043,11 @@ namespace swift::simplugin::flightgear m_conn = QDBusConnection::sessionBus(); if (!m_conn.isConnected()) { - m_conn.disconnectFromBus(m_conn.name()); + QDBusConnection::disconnectFromBus(m_conn.name()); return; } checkConnectionCommon(); - m_conn.disconnectFromBus(m_conn.name()); + QDBusConnection::disconnectFromBus(m_conn.name()); } void CSimulatorFlightgearListener::checkConnectionViaPeer(const QString &address) @@ -1056,11 +1056,11 @@ namespace swift::simplugin::flightgear if (!m_conn.isConnected()) { // This is required to cleanup the connection in QtDBus - m_conn.disconnectFromPeer(m_conn.name()); + QDBusConnection::disconnectFromPeer(m_conn.name()); return; } checkConnectionCommon(); - m_conn.disconnectFromPeer(m_conn.name()); + QDBusConnection::disconnectFromPeer(m_conn.name()); } void CSimulatorFlightgearListener::checkConnectionCommon() @@ -1103,7 +1103,7 @@ namespace swift::simplugin::flightgear void CSimulatorFlightgearListener::serviceRegistered(const QString &serviceName) { if (serviceName == fgswiftbusServiceName()) { emit simulatorStarted(getPluginInfo()); } - m_conn.disconnectFromBus(m_conn.name()); + QDBusConnection::disconnectFromBus(m_conn.name()); } void CSimulatorFlightgearListener::fgSwiftBusServerSettingChanged() diff --git a/src/plugins/simulator/plugincommon/simulatorplugincommon.cpp b/src/plugins/simulator/plugincommon/simulatorplugincommon.cpp index b4133006d..29962751c 100644 --- a/src/plugins/simulator/plugincommon/simulatorplugincommon.cpp +++ b/src/plugins/simulator/plugincommon/simulatorplugincommon.cpp @@ -44,7 +44,7 @@ namespace swift::simplugin::common { if (!m_interpolationDisplayDialog) { - QWidget *parentWidget = sGui ? sGui->mainApplicationWidget() : nullptr; + QWidget *parentWidget = sGui ? CGuiApplication::mainApplicationWidget() : nullptr; auto *dialog = new CInterpolationLogDisplayDialog(this, nullptr, parentWidget); m_interpolationDisplayDialog = dialog; m_interpolationDisplayDialog->setModal(false); diff --git a/src/plugins/simulator/xplane/simulatorxplane.cpp b/src/plugins/simulator/xplane/simulatorxplane.cpp index 760391c77..3c6baf324 100644 --- a/src/plugins/simulator/xplane/simulatorxplane.cpp +++ b/src/plugins/simulator/xplane/simulatorxplane.cpp @@ -542,7 +542,7 @@ namespace swift::simplugin::xplane if (!m_serviceProxy) { return; } CLogMessage(this).info(u"XPlane xSwiftBus service unregistered"); - if (m_dbusMode == P2P) { m_dBusConnection.disconnectFromPeer(m_dBusConnection.name()); } + if (m_dbusMode == P2P) { QDBusConnection::disconnectFromPeer(m_dBusConnection.name()); } m_dBusConnection = QDBusConnection { "default" }; if (m_watcher) { m_watcher->setConnection(m_dBusConnection); } delete m_serviceProxy; @@ -1373,11 +1373,11 @@ namespace swift::simplugin::xplane m_DBusConnection = QDBusConnection::sessionBus(); if (!m_DBusConnection.isConnected()) { - m_DBusConnection.disconnectFromBus(m_DBusConnection.name()); + QDBusConnection::disconnectFromBus(m_DBusConnection.name()); return; } checkConnectionCommon(); // bus - m_DBusConnection.disconnectFromBus(m_DBusConnection.name()); + QDBusConnection::disconnectFromBus(m_DBusConnection.name()); } void CSimulatorXPlaneListener::checkConnectionViaPeer(const QString &address) @@ -1386,11 +1386,11 @@ namespace swift::simplugin::xplane if (!m_DBusConnection.isConnected()) { // This is required to cleanup the connection in QtDBus - m_DBusConnection.disconnectFromPeer(m_DBusConnection.name()); + QDBusConnection::disconnectFromPeer(m_DBusConnection.name()); return; } checkConnectionCommon(); // peer - m_DBusConnection.disconnectFromPeer(m_DBusConnection.name()); + QDBusConnection::disconnectFromPeer(m_DBusConnection.name()); } void CSimulatorXPlaneListener::checkConnectionCommon() @@ -1441,7 +1441,7 @@ namespace swift::simplugin::xplane void CSimulatorXPlaneListener::serviceRegistered(const QString &serviceName) { if (serviceName == xswiftbusServiceName()) { emit simulatorStarted(getPluginInfo()); } - m_DBusConnection.disconnectFromBus(m_DBusConnection.name()); + QDBusConnection::disconnectFromBus(m_DBusConnection.name()); } void CSimulatorXPlaneListener::onXSwiftBusServerSettingChanged() diff --git a/src/swiftlauncher/swiftlauncher.cpp b/src/swiftlauncher/swiftlauncher.cpp index cd96c29a5..0ad7f7184 100644 --- a/src/swiftlauncher/swiftlauncher.cpp +++ b/src/swiftlauncher/swiftlauncher.cpp @@ -183,7 +183,7 @@ void CSwiftLauncher::clearWindowsRegistry() CSwiftLauncher::~CSwiftLauncher() = default; -QString CSwiftLauncher::getCmdLine() const { return this->toCmdLine(m_executable, m_executableArgs); } +QString CSwiftLauncher::getCmdLine() const { return toCmdLine(m_executable, m_executableArgs); } bool CSwiftLauncher::startDetached() { @@ -500,7 +500,7 @@ void CSwiftLauncher::checkRunningApplicationsAndCore() if (m_startMappingToolWaitCycles > 0) { m_startMappingToolWaitCycles--; } if (m_startGuiWaitCycles > 0) { m_startGuiWaitCycles--; } - const CApplicationInfoList runningApps = sGui->getRunningApplications(); + const CApplicationInfoList runningApps = CGuiApplication::getRunningApplications(); const bool foundLocalCore = runningApps.containsApplication(CApplicationInfo::PilotClientCore); const bool foundLocalMappingTool = runningApps.containsApplication(CApplicationInfo::MappingTool); const bool foundLocalPilotClientGui = runningApps.containsApplication(CApplicationInfo::PilotClientGui);