删除eventfilter内无用代码

This commit is contained in:
zhangyuanyuan1 2022-05-27 17:23:39 +08:00
parent c60276ef91
commit 4dfb699615
2 changed files with 2 additions and 12 deletions

View File

@ -167,12 +167,7 @@ bool NetConnect::eventFilter(QObject *w, QEvent *e) {
if (!wiredSwitch->isCheckable()) {
showDesktopNotify(tr("No ethernet device avaliable"));
} else {
if (deviceStatusMap.count() == 0) {
wiredSwitch->setCheckable(false);
wiredSwitch->setChecked(false);
} else {
m_interface->call(QStringLiteral("setWiredSwitchEnable"), !wiredSwitch->isChecked());
}
m_interface->call(QStringLiteral("setWiredSwitchEnable"), !wiredSwitch->isChecked());
return true;
}
}

View File

@ -226,12 +226,7 @@ bool WlanConnect::eventFilter(QObject *w, QEvent *e) {
if (!m_wifiSwitch->isCheckable()) {
showDesktopNotify(tr("No wireless network card detected"));
} else {
if (deviceList.isEmpty()) {
m_wifiSwitch->setCheckable(false);
m_wifiSwitch->setChecked(false);
} else {
m_interface->call(QStringLiteral("setWirelessSwitchEnable"), !m_wifiSwitch->isChecked());
}
m_interface->call(QStringLiteral("setWirelessSwitchEnable"), !m_wifiSwitch->isChecked());
return true;
}
}