From a8d0e8fea60e5c021cca48d14bfebeb0bfa9be24 Mon Sep 17 00:00:00 2001 From: fengshaoxiong Date: Wed, 24 Jun 2020 16:36:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(bluetooth):=20=E8=93=9D=E7=89=99=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E9=87=8D=E6=96=B0=E6=89=93=E5=BC=80=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E8=BF=98=E6=98=BE=E7=A4=BA=E5=B7=B2=E7=BB=8F=E5=85=B3=E9=97=AD?= =?UTF-8?q?=E7=9A=84=E8=93=9D=E7=89=99=E8=AE=BE=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 任务栏关闭蓝牙设备后需要主动发送ClearUnpairedDevice Dbus消息给后端 Log: 解决蓝牙关闭重新打开后,还显示已经关闭的蓝牙设备问题 Bug: https://pms.uniontech.com/zentao/bug-view-34997.html --- plugins/bluetooth/componments/adaptersmanager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/bluetooth/componments/adaptersmanager.cpp b/plugins/bluetooth/componments/adaptersmanager.cpp index 8a00eec4d..caf47f04e 100644 --- a/plugins/bluetooth/componments/adaptersmanager.cpp +++ b/plugins/bluetooth/componments/adaptersmanager.cpp @@ -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(); + }); } } }