diff --git a/deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp b/deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp index b53f9a14..221fd0c1 100644 --- a/deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp +++ b/deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp @@ -105,7 +105,7 @@ void DeviceMonitor::setInfoFromHwinfo(const QMap &mapInfo) setAttribute(mapInfo, "", m_DisplayInput); setAttribute(mapInfo, "Size", m_ScreenSize); setAttribute(mapInfo, "", m_MainScreen); - if (Common::isHwPlatform()){ + if (!Common::isHwPlatform()){ setAttribute(mapInfo, "Resolution", m_SupportResolution); } qCDebug(appLog) << "Basic monitor attributes set - Name:" << m_Name << "Vendor:" << m_Vendor << "Model:" << m_Model; @@ -117,7 +117,7 @@ void DeviceMonitor::setInfoFromHwinfo(const QMap &mapInfo) qCDebug(appLog) << "Screen size parsed:" << m_ScreenSize << "Width:" << size.width() << "Height:" << size.height(); // 获取当前分辨率 和 当前支持分辨率 - if (Common::isHwPlatform()){ + if (!Common::isHwPlatform()){ QStringList listResolution = m_SupportResolution.split(" "); m_SupportResolution = ""; foreach (const QString &word, listResolution) { @@ -131,7 +131,7 @@ void DeviceMonitor::setInfoFromHwinfo(const QMap &mapInfo) // 计算显示比例 caculateScreenRatio(); - if (Common::isHwPlatform()){ + if (!Common::isHwPlatform()){ m_SupportResolution.replace(QRegularExpression(", $"), ""); } qCDebug(appLog) << "Supported resolutions processed:" << m_SupportResolution; diff --git a/deepin-devicemanager/src/GenerateDevice/CmdTool.cpp b/deepin-devicemanager/src/GenerateDevice/CmdTool.cpp index 599756a8..0445332f 100644 --- a/deepin-devicemanager/src/GenerateDevice/CmdTool.cpp +++ b/deepin-devicemanager/src/GenerateDevice/CmdTool.cpp @@ -1553,7 +1553,7 @@ void CmdTool::getMapInfoFromSmartctl(QMap &mapInfo, const QStr indexName = ""; - QRegularExpression rx("^[ ]*[0-9]+[ ]+([\\w-_]+)[ ]+0x[0-9a-fA-F-]+[ ]+[0-9]+[ ]+[0-9]+[ ]+[0-9]+[ ]+[\\w-]+[ ]+[\\w-]+[ ]+[\\w-]+[ ]+([0-9\\/w-]+[ ]*[ 0-9\\/w-()]*)$"); + QRegularExpression rx("^[ ]*[0-9]+[ ]+([\\w_-]+)[ ]+0x[0-9a-fA-F-]+[ ]+[0-9]+[ ]+[0-9]+[ ]+[0-9]+[ ]+[\\w-]+[ ]+[\\w-]+[ ]+[\\w-]+[ ]+([0-9\\w\\/-]+[ ]*[0-9\\w\\/\\-\\(\\)]*)$"); if (rx.match(line).hasMatch()) { // qCDebug(appLog) << "Matched smartctl attribute regex:" << line; mapInfo[rx.match(line).captured(1)] = rx.match(line).captured(2);