diff --git a/deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp b/deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp index 4c612fa0..b590dad6 100644 --- a/deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp +++ b/deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp @@ -96,7 +96,9 @@ void DeviceMonitor::setInfoFromHwinfo(const QMap &mapInfo) setAttribute(mapInfo, "", m_DisplayInput); setAttribute(mapInfo, "Size", m_ScreenSize); setAttribute(mapInfo, "", m_MainScreen); -// setAttribute(mapInfo, "Resolution", m_SupportResolution); + if (Common::specialComType > 0){ + setAttribute(mapInfo, "Resolution", m_SupportResolution); + } double inch = 0.0; QSize size(0, 0); @@ -104,19 +106,22 @@ void DeviceMonitor::setInfoFromHwinfo(const QMap &mapInfo) m_ScreenSize = inchValue; // 获取当前分辨率 和 当前支持分辨率 -// QStringList listResolution = m_SupportResolution.split(" "); -// m_SupportResolution = ""; -// foreach (const QString &word, listResolution) { -// if (word.contains("@")) { -// m_SupportResolution.append(word); -// m_SupportResolution.append(", "); -// } -// } + if (Common::specialComType > 0){ + QStringList listResolution = m_SupportResolution.split(" "); + m_SupportResolution = ""; + foreach (const QString &word, listResolution) { + if (word.contains("@")) { + m_SupportResolution.append(word); + m_SupportResolution.append(", "); + } + } + } // 计算显示比例 caculateScreenRatio(); - -// m_SupportResolution.replace(QRegExp(", $"), ""); + if (Common::specialComType > 0){ + m_SupportResolution.replace(QRegExp(", $"), ""); + } m_ProductionWeek = transWeekToDate(mapInfo["Year of Manufacture"], mapInfo["Week of Manufacture"]); setAttribute(mapInfo, "Serial ID", m_SerialNumber); @@ -207,17 +212,19 @@ bool DeviceMonitor::setInfoFromXradr(const QString &main, const QString &edid, c } } - QMap monitorResolutionMap = getMonitorResolutionMap(xrandr, m_RawInterface); + if (Common::specialComType <= 0) { + QMap monitorResolutionMap = getMonitorResolutionMap(xrandr, m_RawInterface); - if (monitorResolutionMap.size() == 1) { - m_SupportResolution.clear(); - foreach (const QString &word, monitorResolutionMap.value(m_RawInterface)) { - if (word.contains("@")) { - m_SupportResolution.append(word); - m_SupportResolution.append(", "); + if (monitorResolutionMap.size() == 1) { + m_SupportResolution.clear(); + foreach (const QString &word, monitorResolutionMap.value(m_RawInterface)) { + if (word.contains("@")) { + m_SupportResolution.append(word); + m_SupportResolution.append(", "); + } } + m_SupportResolution.replace(QRegExp(", $"), ""); } - m_SupportResolution.replace(QRegExp(", $"), ""); } return false; } diff --git a/deepin-devicemanager/src/Page/MainWindow.cpp b/deepin-devicemanager/src/Page/MainWindow.cpp index d7206938..6a932a22 100644 --- a/deepin-devicemanager/src/Page/MainWindow.cpp +++ b/deepin-devicemanager/src/Page/MainWindow.cpp @@ -524,12 +524,14 @@ void MainWindow::slotLoadingFinish(const QString &message) mp_DeviceWidget->updateDevice(mp_DeviceWidget->currentIndex(), lst); // bug-325731 - if (mp_DeviceWidget->currentIndex() == QObject::tr("Monitor")) { - QtConcurrent::run([=](){ - QThread::msleep(700); - emit mp_DeviceWidget->itemClicked(mp_DeviceWidget->currentIndex()); - qWarning() << mp_DeviceWidget->currentIndex(); - }); + if (Common::specialComType <= 0) { + if (mp_DeviceWidget->currentIndex() == QObject::tr("Monitor")) { + QtConcurrent::run([=](){ + QThread::msleep(700); + emit mp_DeviceWidget->itemClicked(mp_DeviceWidget->currentIndex()); + qWarning() << mp_DeviceWidget->currentIndex(); + }); + } } } else { QMap overviewMap = DeviceManager::instance()->getDeviceOverview(); diff --git a/deepin-devicemanager/src/Tool/ThreadExecXrandr.cpp b/deepin-devicemanager/src/Tool/ThreadExecXrandr.cpp index 330145c0..5d06b5f7 100644 --- a/deepin-devicemanager/src/Tool/ThreadExecXrandr.cpp +++ b/deepin-devicemanager/src/Tool/ThreadExecXrandr.cpp @@ -150,7 +150,6 @@ void ThreadExecXrandr::loadXrandrVerboseInfo(QList> &lstM // 获取当前频率 if ((*it).contains("*current")) { - // QString ss = *it; if ((it += 2) >= lines.end()) return; QRegExp regRate(".*([0-9]{1,5}\\.[0-9]{1,5}Hz).*");