Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ project(dde-network-core
LANGUAGES CXX C
)

option(ENABLE_DEEPIN_NMQT "enable nmqt patch on deepin" ON)
option(BUILD_TESTS "Build unit tests" OFF)
option(BUILD_EXAMPLE "Build example programs" OFF)

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

if (ENABLE_DEEPIN_NMQT)
add_definitions(-DUSE_DEEPIN_NMQT)
endif()

message(STATUS DEEPIN_NMQT_TEST ": ${DEEPIN_NMQT_TEST}")

set(INTERFACE_VERSION "2.0")
Expand Down
19 changes: 4 additions & 15 deletions src/impl/networkmanager/networkmanagerprocesser.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2018 - 2022 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2018 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -186,12 +186,7 @@ void NetworkManagerProcesser::createOrRemoveDevice(const QString &path)
}
};

if (device->managed()
#ifdef USE_DEEPIN_NMQT
&& ((device->interfaceFlags() & DEVICE_INTERFACE_FLAG_UP) ||
device->type() == NetworkManager::Device::Wifi)
#endif
) {
if (device->managed() && ((device->interfaceFlags() & DEVICE_INTERFACE_FLAG_UP) || device->type() == NetworkManager::Device::Wifi)) {
// 如果由非manager变成manager的模式,则新增设备
if (!deviceExist(device->uni())) {
NetworkDeviceBase *newDevice = createDevice(device);
Expand Down Expand Up @@ -327,21 +322,15 @@ void NetworkManagerProcesser::onDeviceAdded(const QString &uni)
}
}

#ifdef USE_DEEPIN_NMQT
connect(currentDevice.get(), &NetworkManager::Device::interfaceFlagsChanged, currentDevice.get(), [ uni, this ] {
createOrRemoveDevice(uni);
});
#endif

connect(currentDevice.get(), &NetworkManager::Device::managedChanged, currentDevice.get(), [ uni, this ] {
createOrRemoveDevice(uni);
});

if (currentDevice->managed()
#ifdef USE_DEEPIN_NMQT
&& ((currentDevice->interfaceFlags() & DEVICE_INTERFACE_FLAG_UP) ||
currentDevice->type() == NetworkManager::Device::Wifi)
#endif
) {
if (currentDevice->managed() && ((currentDevice->interfaceFlags() & DEVICE_INTERFACE_FLAG_UP) || currentDevice->type() == NetworkManager::Device::Wifi)) {
NetworkDeviceBase *newDevice = createDevice(currentDevice);
connect(newDevice, &NetworkDeviceBase::deviceStatusChanged, this, &NetworkManagerProcesser::onUpdateNetworkDetail);
connect(newDevice, &NetworkDeviceBase::activeConnectionChanged, this, &NetworkManagerProcesser::onUpdateNetworkDetail);
Expand Down
Loading