fix(bluetooth): 蓝牙关闭重新打开后,还显示已经关闭的蓝牙设备

任务栏关闭蓝牙设备后需要主动发送ClearUnpairedDevice Dbus消息给后端

Log: 解决蓝牙关闭重新打开后,还显示已经关闭的蓝牙设备问题
Bug: https://pms.uniontech.com/zentao/bug-view-34997.html
This commit is contained in:
fengshaoxiong 2020-06-24 16:36:07 +08:00
parent 16374fb637
commit a8d0e8fea6

View File

@ -110,6 +110,13 @@ void AdaptersManager::setAdapterPowered(const Adapter *adapter, const bool &powe
qWarning() << call.error().message();
}
});
} else {
QDBusPendingCall call = m_bluetoothInter->ClearUnpairedDevice();
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(call, this);
connect(watcher, &QDBusPendingCallWatcher::finished, [ = ] {
if (call.isError())
qWarning() << call.error().message();
});
}
}
}