diff --git a/deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp b/deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp index 332a7a9b..4b016dba 100644 --- a/deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp +++ b/deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp @@ -258,7 +258,7 @@ void DeviceCpu::setInfoFromDmidecode(const QMap &mapInfo) setAttribute(mapInfo, "product", m_Name); } - if (Common::specialComType > 0) { + if (Common::isHwPlatform()) { if (mapInfo.contains("Version")) { setAttribute(mapInfo, "Version", m_Name); } diff --git a/deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp b/deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp index 7e615db8..c2f12dbf 100644 --- a/deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp +++ b/deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp @@ -96,7 +96,7 @@ void DeviceMonitor::setInfoFromHwinfo(const QMap &mapInfo) setAttribute(mapInfo, "", m_DisplayInput); setAttribute(mapInfo, "Size", m_ScreenSize); setAttribute(mapInfo, "", m_MainScreen); - if (Common::specialComType > 0){ + if (Common::isHwPlatform()){ setAttribute(mapInfo, "Resolution", m_SupportResolution); } @@ -106,7 +106,7 @@ void DeviceMonitor::setInfoFromHwinfo(const QMap &mapInfo) m_ScreenSize = inchValue; // 获取当前分辨率 和 当前支持分辨率 - if (Common::specialComType > 0){ + if (Common::isHwPlatform()){ QStringList listResolution = m_SupportResolution.split(" "); m_SupportResolution = ""; foreach (const QString &word, listResolution) { @@ -119,7 +119,7 @@ void DeviceMonitor::setInfoFromHwinfo(const QMap &mapInfo) // 计算显示比例 caculateScreenRatio(); - if (Common::specialComType > 0){ + if (Common::isHwPlatform()){ m_SupportResolution.replace(QRegExp(", $"), ""); } @@ -290,7 +290,7 @@ bool DeviceMonitor::available() QString DeviceMonitor::subTitle() { - if (Common::specialComType >= 1) { + if (Common::isHwPlatform()) { m_Name.clear(); } return m_Name; diff --git a/deepin-devicemanager/src/Page/PageMultiInfo.cpp b/deepin-devicemanager/src/Page/PageMultiInfo.cpp index 3edeea66..541ecbf6 100644 --- a/deepin-devicemanager/src/Page/PageMultiInfo.cpp +++ b/deepin-devicemanager/src/Page/PageMultiInfo.cpp @@ -91,7 +91,7 @@ void PageMultiInfo::updateInfo(const QList &lst) mp_Table->setVisible(true); mp_Table->setFixedHeight(TABLE_HEIGHT); mp_Table->updateTable(m_deviceList, m_menuControlList); - if (Common::specialComType >= 1) { + if (Common::isHwPlatform()) { if (mp_Label->text() == tr("Storage") || mp_Label->text() == tr("Memory") || mp_Label->text() == tr("Monitor")) { mp_Table->setVisible(false); mp_Table->setFixedHeight(0); @@ -130,19 +130,19 @@ void PageMultiInfo::resizeEvent(QResizeEvent *e) int curHeight = this->height(); if (curHeight < LEAST_PAGE_HEIGHT) { // 获取多个设备界面表格信息 - if (Common::specialComType <= 0) { - mp_Table->updateTable(m_deviceList, m_menuControlList, true, (LEAST_PAGE_HEIGHT - curHeight) / TREE_ROW_HEIGHT + 1); - } else { + if (Common::isHwPlatform()) { if (mp_Label->text() != tr("Storage") && mp_Label->text() != tr("Memory") && mp_Label->text() != tr("Monitor")) mp_Table->updateTable(m_deviceList, m_menuControlList, true, (LEAST_PAGE_HEIGHT - curHeight) / TREE_ROW_HEIGHT + 1); + } else { + mp_Table->updateTable(m_deviceList, m_menuControlList, true, (LEAST_PAGE_HEIGHT - curHeight) / TREE_ROW_HEIGHT + 1); } } else { // 获取多个设备界面表格信息 - if (Common::specialComType <= 0) { - mp_Table->updateTable(m_deviceList, m_menuControlList, true, 0); - } else { + if (Common::isHwPlatform()) { if (mp_Label->text() != tr("Storage") && mp_Label->text() != tr("Memory") && mp_Label->text() != tr("Monitor")) mp_Table->updateTable(m_deviceList, m_menuControlList, true, 0); + } else { + mp_Table->updateTable(m_deviceList, m_menuControlList, true, 0); } } diff --git a/deepin-devicemanager/src/Tool/EDIDParser.cpp b/deepin-devicemanager/src/Tool/EDIDParser.cpp index 2eaff9ea..fb67b226 100644 --- a/deepin-devicemanager/src/Tool/EDIDParser.cpp +++ b/deepin-devicemanager/src/Tool/EDIDParser.cpp @@ -211,12 +211,14 @@ void EDIDParser::parseScreenSize() } } - if (Common::specialComType == 7){ // sepcial task:378963 + if (Common::specialComType == Common::kSpecialType7){ // sepcial task:378963 m_Width = 296; m_Height = 197; } double inch = sqrt((m_Width / 2.54) * (m_Width / 2.54) + (m_Height / 2.54) * (m_Height / 2.54))/10; - m_ScreenSize = QString("%1 %2(%3mm×%4mm)").arg(QString::number(inch, '0', Common::specialComType == 7 ? 0 : 1)).arg(QObject::tr("inch")).arg(m_Width).arg(m_Height); + m_ScreenSize = QString("%1 %2(%3mm×%4mm)") + .arg(QString::number(inch, '0', Common::specialComType == Common::kSpecialType7 ? 0 : 1)) + .arg(QObject::tr("inch")).arg(m_Width).arg(m_Height); } void EDIDParser::parseMonitorName()