Skip to content

Commit

Permalink
fix: the device of monitor display
Browse files Browse the repository at this point in the history
fix the device of monitor display

Log: fix the device of monitor display

Bug: https://pms.uniontech.com/bug-view-296425.html
https: //pms.uniontech.com/bug-view-296689.html
Change-Id: Ief79bbd158fef4f7a2b9332ec87e82246cd55a87
  • Loading branch information
add-uos committed Dec 30, 2024
1 parent 366a729 commit ced1d8b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ const QString DeviceMonitor::getOverviewInfo()
QString ov;

ov = QString("%1(%2)").arg(m_Name).arg(m_ScreenSize);

Check warning on line 251 in deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Variable 'ov' is reassigned a value before the old one has been used.
if (Common::specialComType == 6) {
ov = QString("(%1)").arg(m_ScreenSize);
} else {
ov = QString("%1(%2)").arg(m_Name).arg(m_ScreenSize);
}

return ov;
}
Expand All @@ -261,7 +266,8 @@ void DeviceMonitor::initFilterKey()
void DeviceMonitor::loadBaseDeviceInfo()
{
// 添加基本信息
addBaseDeviceInfo(("Name"), m_Name);
if (Common::specialComType != 6)
addBaseDeviceInfo(("Name"), m_Name);
addBaseDeviceInfo(("Vendor"), m_Vendor);
addBaseDeviceInfo(("Type"), m_Model);
addBaseDeviceInfo(("Display Input"), m_DisplayInput);
Expand Down Expand Up @@ -333,10 +339,10 @@ bool DeviceMonitor::setMainInfoFromXrandr(const QString &info, const QString &ra
curRate = QString::number(ceil(curRate.left(pos).toDouble())) + curRate.right(curRate.size() - pos);
}
}
if (Common::specialComType == 1) {
if (Common::specialComType == 1 || Common::specialComType == 6) {
m_RefreshRate = QString("%1").arg(curRate);
}
if (Common::specialComType == 5) {
if (Common::specialComType == 5 || Common::specialComType == 6) {
m_CurrentResolution = QString("%1").arg(reScreenSize.cap(1));
} else {
m_CurrentResolution = QString("%1 @%2").arg(reScreenSize.cap(1)).arg(curRate);
Expand Down

0 comments on commit ced1d8b

Please sign in to comment.