1 Star 0 Fork 11

dde-openeuler/deepin-devicemanager

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0002-fix-Ethernet-Controller-X710-disable.patch 2.55 KB
一键复制 编辑 原始数据 按行查看 历史
Venland 提交于 2023-07-26 16:26 . upgrade to version 5.6.36
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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dde-openeuler/deepin-devicemanager.git
git@gitee.com:dde-openeuler/deepin-devicemanager.git
dde-openeuler
deepin-devicemanager
deepin-devicemanager
master

搜索帮助