Skip to content

Commit 01b20b2

Browse files
committed
fix: fixed the wired device show error
because we used the macro, so the condition is error, the wired device which is off will show PMS: BUG-308755
1 parent 4eedd00 commit 01b20b2

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ project(dde-network-core
88
LANGUAGES CXX C
99
)
1010

11-
option(ENABLE_DEEPIN_NMQT "enable nmqt patch on deepin" ON)
1211
option(BUILD_TESTS "Build unit tests" OFF)
1312
option(BUILD_EXAMPLE "Build example programs" OFF)
1413

@@ -34,10 +33,6 @@ if (CMAKE_BUILD_TYPE STREQUAL "Debug")
3433
message(STATUS ${result})
3534
endif()
3635

37-
if (ENABLE_DEEPIN_NMQT)
38-
add_definitions(-DUSE_DEEPIN_NMQT)
39-
endif()
40-
4136
message(STATUS DEEPIN_NMQT_TEST ": ${DEEPIN_NMQT_TEST}")
4237

4338
set(INTERFACE_VERSION "2.0")

src/impl/networkmanager/networkmanagerprocesser.cpp

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)