Skip to content

Commit 9052d41

Browse files
ut003640deepin-bot[bot]
authored andcommitted
fix: Fix interface not displaying in real-time after inserting wired network card
After inserting a wired network card, the managed and interfaceFlag properties initially have values of false and None. When using the NetworkManager::findNetworkInterface method to search, the newly created Device object has not yet assigned values to the interfaceFlag and managed properties, so the system considers the device to be in an unmanaged state and does not display it to the user. The fix involves waiting for the newly created device object's property assignment to complete before proceeding. Log: Fix interface not responding after inserting network card PMS: BUG-351709 fix: 修复插入有线网卡后界面没有实时显示 在插入有线网卡后,managed和interfaceFlag属性初始值为false和None,在通过NetworkManager::findNetworkInterface方法来查找时,新生成的Device对象还没有将interfaceFlag和managed属性赋值,所以系统认为该设备是未管理状态,不会显示给用户;修改为等新创建的设备对象属性赋值完成后就可以解决问题 Log: 修复插入网卡后界面无反应
1 parent 5c44316 commit 9052d41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/impl/networkmanager/networkmanagerprocesser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,11 @@ void NetworkManagerProcesser::onDeviceAdded(const QString &uni)
324324

325325
connect(currentDevice.get(), &NetworkManager::Device::interfaceFlagsChanged, currentDevice.get(), [ uni, this ] {
326326
createOrRemoveDevice(uni);
327-
});
327+
}, Qt::QueuedConnection);
328328

329329
connect(currentDevice.get(), &NetworkManager::Device::managedChanged, currentDevice.get(), [ uni, this ] {
330330
createOrRemoveDevice(uni);
331-
});
331+
}, Qt::QueuedConnection);
332332

333333
if (currentDevice->managed() && ((currentDevice->interfaceFlags() & DEVICE_INTERFACE_FLAG_UP) || currentDevice->type() == NetworkManager::Device::Wifi)) {
334334
NetworkDeviceBase *newDevice = createDevice(currentDevice);

0 commit comments

Comments
 (0)