fix: 热插拔无线网卡后飞行模式没有显示

需要关联设备信号,刷新飞行模式

Log: 飞行模式热插拔显示和隐藏
Influence: 飞行模式
Task: https://pms.uniontech.com/bug-view-155145.html
This commit is contained in:
zengaoyuan 2022-08-25 16:55:57 +08:00 committed by KT-lcz
parent fb77866a65
commit 458ade5359
2 changed files with 11 additions and 1 deletions

View File

@ -51,7 +51,7 @@ void AirplaneModePlugin::init(PluginProxyInterface *proxyInter)
{
m_proxyInter = proxyInter;
if (supportAirplaneMode()) {
if (getAirplaneDconfig()) {
m_networkInter = new NetworkInter("com.deepin.daemon.Network", "/com/deepin/daemon/Network", QDBusConnection::sessionBus(), this);
connect(m_networkInter, &NetworkInter::WirelessAccessPointsChanged, this, &AirplaneModePlugin::onWirelessAccessPointsOrAdapterChange);
@ -240,4 +240,13 @@ bool AirplaneModePlugin::supportAirplaneMode() const
return false;
}
bool AirplaneModePlugin::getAirplaneDconfig() const
{
bool airplane = false;
if (m_dconfig && m_dconfig->isValid()) {
airplane = m_dconfig->value("networkAirplaneMode", false).toBool();
}
return airplane;
}

View File

@ -61,6 +61,7 @@ public:
private:
bool supportAirplaneMode() const;
bool getAirplaneDconfig() const;
public slots:
void refreshAirplaneEnableState();