代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/deepin-devicemanager 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 0f2dfc4c0e377d0cf2d6723ac1d5bbd0ec391c13 Mon Sep 17 00:00:00 2001
From: shuaijie <shuaijie@uniontech.com>
Date: Thu, 13 Apr 2023 21:46:26 +0800
Subject: [PATCH] fix: Ethernet Controller X710 disable
Ethernet Controller X710 disable
Log: Ethernet Controller X710 disable
Bug: https://pms.uniontech.com/bug-view-188969.html
Change-Id: I93d8157652e23796d91d9ba293f887c988502b0f
---
deepin-devicemanager/src/GenerateDevice/CmdTool.cpp | 5 ++++-
.../src/GenerateDevice/DeviceGenerator.cpp | 9 ++++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/deepin-devicemanager/src/GenerateDevice/CmdTool.cpp b/deepin-devicemanager/src/GenerateDevice/CmdTool.cpp
index 6a018adf..0f0f93b2 100644
--- a/deepin-devicemanager/src/GenerateDevice/CmdTool.cpp
+++ b/deepin-devicemanager/src/GenerateDevice/CmdTool.cpp
@@ -738,7 +738,10 @@ void CmdTool::getMapInfoFromLshw(const QString &info, QMap<QString, QString> &ma
mapInfo[attr[0].trimmed()] += attr[1].trimmed();
}
} else {
- mapInfo.insert(words[0].trimmed(), words[1].trimmed());
+ if (info.startsWith("network") && true == words[0].contains("logical name") && true == words[1].contains("dev/fb")) {
+ continue;
+ } else
+ mapInfo.insert(words[0].trimmed(), words[1].trimmed());
}
}
}
diff --git a/deepin-devicemanager/src/GenerateDevice/DeviceGenerator.cpp b/deepin-devicemanager/src/GenerateDevice/DeviceGenerator.cpp
index 219ca518..7f4b2d51 100644
--- a/deepin-devicemanager/src/GenerateDevice/DeviceGenerator.cpp
+++ b/deepin-devicemanager/src/GenerateDevice/DeviceGenerator.cpp
@@ -27,6 +27,7 @@
// Qt库文件
#include <QDebug>
+#include <QDir>
DeviceGenerator::DeviceGenerator(QObject *parent)
: QObject(parent)
@@ -173,8 +174,14 @@ void DeviceGenerator::generatorNetworkDevice()
for (; it != lstInfo.end(); ++it) {
if ((*it).size() < 2)
continue;
- if((*it).find("logical name") == (*it).end() || (*it).find("serial") == (*it).end())
+ if ((*it).find("logical name") == (*it).end() || (*it).find("serial") == (*it).end())
continue;
+ QString logicalname = (*it).value("logical name");
+ QString sysClassNet_path = "/sys/class/net/" + logicalname + "/device";
+ QDir dir(sysClassNet_path);
+ if (! dir.exists())
+ continue;
+
DeviceNetwork *device = new DeviceNetwork();
device->setInfoFromLshw(*it);
DeviceManager::instance()->addNetworkDevice(device);
--
2.20.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。