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
2 changes: 1 addition & 1 deletion net-view/operation/netmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ void NetManagerPrivate::updateAirplaneMode(bool enabled)
Q_Q(NetManager);
Q_EMIT q->airplaneModeChanged(m_airplaneMode);
}
updateItemVisible("NetAirplaneModeTipsItem", enabled && m_managerThread->supportWireless());
updateItemVisible("NetAirplaneModeTipsItem", enabled);
if (enabled) {
updateItemVisible("NetWirelessDisabledItem", false);
updateItemVisible("NetWiredDisabledItem", false);
Expand Down
19 changes: 7 additions & 12 deletions net-view/operation/private/netmanagerthreadprivate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,6 @@ bool NetManagerThreadPrivate::CheckPasswordValid(const QString &key, const QStri
return !password.isEmpty();
}

bool NetManagerThreadPrivate::supportWireless() const
{
NetworkManager::Device::List devices = NetworkManager::networkInterfaces();
for (NetworkManager::Device::Ptr device : devices) {
if (device->type() == NetworkManager::Device::Type::Wifi && device->managed())
return true;
}

return false;
}

void NetManagerThreadPrivate::getNetCheckAvailableFromDBus()
{
QDBusMessage message = QDBusMessage::createMethodCall("com.deepin.defender.netcheck", "/com/deepin/defender/netcheck", "org.freedesktop.DBus.Properties", "Get");
Expand Down Expand Up @@ -872,7 +861,13 @@ bool NetManagerThreadPrivate::supportAirplaneMode() const
}
}

return supportWireless();
NetworkManager::Device::List devices = NetworkManager::networkInterfaces();
for (NetworkManager::Device::Ptr device : devices) {
if (device->type() == NetworkManager::Device::Type::Wifi && device->managed())
return true;
}

return false;
}

void NetManagerThreadPrivate::doConnectOrInfo(const QString &id, NetType::NetItemType type, const QVariantMap &param)
Expand Down
2 changes: 0 additions & 2 deletions net-view/operation/private/netmanagerthreadprivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ class NetManagerThreadPrivate : public QObject

inline bool AirplaneModeEnabled() const { return m_airplaneModeEnabled; }

bool supportWireless() const;

void setEnabled(bool enabled);
void setAutoScanInterval(int ms);
void setAutoScanEnabled(bool enabled);
Expand Down