@@ -186,12 +186,7 @@ void NetworkManagerProcesser::createOrRemoveDevice(const QString &path)
186186 }
187187 };
188188
189- if (device->managed ()
190- #ifdef USE_DEEPIN_NMQT
191- && ((device->interfaceFlags () & DEVICE_INTERFACE_FLAG_UP) ||
192- device->type () == NetworkManager::Device::Wifi)
193- #endif
194- ) {
189+ if (device->managed () && ((device->interfaceFlags () & DEVICE_INTERFACE_FLAG_UP) || device->type () == NetworkManager::Device::Wifi)) {
195190 // 如果由非manager变成manager的模式,则新增设备
196191 if (!deviceExist (device->uni ())) {
197192 NetworkDeviceBase *newDevice = createDevice (device);
@@ -327,21 +322,15 @@ void NetworkManagerProcesser::onDeviceAdded(const QString &uni)
327322 }
328323 }
329324
330- #ifdef USE_DEEPIN_NMQT
331325 connect (currentDevice.get (), &NetworkManager::Device::interfaceFlagsChanged, currentDevice.get (), [ uni, this ] {
332326 createOrRemoveDevice (uni);
333327 });
334- # endif
328+
335329 connect (currentDevice.get (), &NetworkManager::Device::managedChanged, currentDevice.get (), [ uni, this ] {
336330 createOrRemoveDevice (uni);
337331 });
338332
339- if (currentDevice->managed ()
340- #ifdef USE_DEEPIN_NMQT
341- && ((currentDevice->interfaceFlags () & DEVICE_INTERFACE_FLAG_UP) ||
342- currentDevice->type () == NetworkManager::Device::Wifi)
343- #endif
344- ) {
333+ if (currentDevice->managed () && ((currentDevice->interfaceFlags () & DEVICE_INTERFACE_FLAG_UP) || currentDevice->type () == NetworkManager::Device::Wifi)) {
345334 NetworkDeviceBase *newDevice = createDevice (currentDevice);
346335 connect (newDevice, &NetworkDeviceBase::deviceStatusChanged, this , &NetworkManagerProcesser::onUpdateNetworkDetail);
347336 connect (newDevice, &NetworkDeviceBase::activeConnectionChanged, this , &NetworkManagerProcesser::onUpdateNetworkDetail);
0 commit comments