mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
Merge branch 'fengshaoxiong/uos_Bug33367-2' into 'uos'
fix(bluetooth): dde-session-daemon重启后,蓝牙设备显示混乱; See merge request dde-v20/dde-dock!636
This commit is contained in:
commit
5cb2778bdb
@ -192,6 +192,16 @@ void BluetoothApplet::addAdapter(Adapter *adapter)
|
||||
}
|
||||
|
||||
QString adapterId = adapter->id();
|
||||
//dde-session-daemon重启的时候,同一个Id的蓝牙设备会再次添加一次,因此需要先移除以前的
|
||||
if (m_adapterItems.contains(adapterId)) {
|
||||
AdapterItem *adapterItem = m_adapterItems.value(adapterId);
|
||||
if (adapterItem) {
|
||||
m_adapterLayout->removeWidget(adapterItem);
|
||||
delete adapterItem;
|
||||
m_adapterItems.remove(adapterId);
|
||||
}
|
||||
}
|
||||
|
||||
auto adatpterItem = new AdapterItem(m_adaptersManager, adapter, this);
|
||||
m_adapterItems[adapterId] = adatpterItem;
|
||||
m_adapterLayout->addWidget(adatpterItem);
|
||||
|
Loading…
x
Reference in New Issue
Block a user