|
1 | | -// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd. |
| 1 | +// SPDX-FileCopyrightText: 2018 - 2026 UnionTech Software Technology Co., Ltd. |
2 | 2 | // |
3 | 3 | // SPDX-License-Identifier: GPL-3.0-or-later |
4 | 4 |
|
@@ -186,12 +186,7 @@ void NetworkManagerProcesser::createOrRemoveDevice(const QString &path) |
186 | 186 | } |
187 | 187 | }; |
188 | 188 |
|
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)) { |
195 | 190 | // 如果由非manager变成manager的模式,则新增设备 |
196 | 191 | if (!deviceExist(device->uni())) { |
197 | 192 | NetworkDeviceBase *newDevice = createDevice(device); |
@@ -327,21 +322,15 @@ void NetworkManagerProcesser::onDeviceAdded(const QString &uni) |
327 | 322 | } |
328 | 323 | } |
329 | 324 |
|
330 | | -#ifdef USE_DEEPIN_NMQT |
331 | 325 | connect(currentDevice.get(), &NetworkManager::Device::interfaceFlagsChanged, currentDevice.get(), [ uni, this ] { |
332 | 326 | createOrRemoveDevice(uni); |
333 | 327 | }); |
334 | | -#endif |
| 328 | + |
335 | 329 | connect(currentDevice.get(), &NetworkManager::Device::managedChanged, currentDevice.get(), [ uni, this ] { |
336 | 330 | createOrRemoveDevice(uni); |
337 | 331 | }); |
338 | 332 |
|
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)) { |
345 | 334 | NetworkDeviceBase *newDevice = createDevice(currentDevice); |
346 | 335 | connect(newDevice, &NetworkDeviceBase::deviceStatusChanged, this, &NetworkManagerProcesser::onUpdateNetworkDetail); |
347 | 336 | connect(newDevice, &NetworkDeviceBase::activeConnectionChanged, this, &NetworkManagerProcesser::onUpdateNetworkDetail); |
|
0 commit comments