mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-11 20:29:47 +08:00
refactor: Fix readability-static-accessed-through-instance warnings
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user