diff --git a/deepin-devicemanager/src/DeviceManager/DeviceManager.cpp b/deepin-devicemanager/src/DeviceManager/DeviceManager.cpp index da62ec31..4df09176 100644 --- a/deepin-devicemanager/src/DeviceManager/DeviceManager.cpp +++ b/deepin-devicemanager/src/DeviceManager/DeviceManager.cpp @@ -696,11 +696,6 @@ void DeviceManager::tomlDeviceSet(DeviceType deviceType) DeviceBaseInfo *newDevice = createDevice(deviceType); tomlDeviceMapSet(deviceType, newDevice, tomlMapLst[j]); tomlDeviceAdd(deviceType, newDevice); //加 - } else if ((deviceType != DT_Bios) && (deviceType != DT_Computer) && !fixSameOne) { - fixSameOne = true; //标记为该项信息有用过 ,则不再增加了 - DeviceBaseInfo *device = createDevice(deviceType); - tomlDeviceMapSet(deviceType, device, tomlMapLst[j]); - tomlDeviceAdd(deviceType, device); //不存在 就加 } } //end of for (int j = 0;... } diff --git a/deepin-devicemanager/src/DeviceManager/DevicePower.cpp b/deepin-devicemanager/src/DeviceManager/DevicePower.cpp index 0fea39c8..c2c1e398 100644 --- a/deepin-devicemanager/src/DeviceManager/DevicePower.cpp +++ b/deepin-devicemanager/src/DeviceManager/DevicePower.cpp @@ -71,7 +71,9 @@ bool DevicePower::setInfoFromUpower(const QMap &mapInfo) { qCDebug(appLog) << "DevicePower::setInfoFromUpower"; // 设置upower中获取的信息 - if (mapInfo["Device"].contains("line_power", Qt::CaseInsensitive)) { + if (mapInfo["Device"].contains("line_power", Qt::CaseInsensitive) || + mapInfo["state"].contains("empty", Qt::CaseInsensitive) || + mapInfo["state"].contains("unknown", Qt::CaseInsensitive)) { qCDebug(appLog) << "DevicePower::setInfoFromUpower, device contains line_power"; return false; } @@ -207,7 +209,7 @@ void DevicePower::loadBaseDeviceInfo() addBaseDeviceInfo("SBDS Serial Number", m_SBDSSerialNumber); addBaseDeviceInfo("SBDS Manufacture Date", m_SBDSManufactureDate); addBaseDeviceInfo("SBDS Chemistry", m_SBDSChemistry); - addBaseDeviceInfo("Temperature", m_Temp); + addBaseDeviceInfo(("Temperature"), m_Temp.replace("degrees C", "℃", Qt::CaseInsensitive)); } void DevicePower::loadOtherDeviceInfo() diff --git a/deepin-devicemanager/src/Tool/ThreadExecXrandr.cpp b/deepin-devicemanager/src/Tool/ThreadExecXrandr.cpp index 5e314f44..1b336e14 100644 --- a/deepin-devicemanager/src/Tool/ThreadExecXrandr.cpp +++ b/deepin-devicemanager/src/Tool/ThreadExecXrandr.cpp @@ -151,6 +151,10 @@ void ThreadExecXrandr::loadXrandrVerboseInfo(QList> &lstM // 新的显示屏 QMap newMap; newMap.insert("mainInfo", (*it).trimmed()); + auto mainInfoList = (*it).trimmed().split(" "); + if (mainInfoList.size() > 0) { + newMap.insert("port", mainInfoList.at(0)); + } lstMap.append(newMap); continue; } @@ -276,9 +280,12 @@ void ThreadExecXrandr::getMonitorInfoFromXrandrVerbose() QList> lstMap; loadXrandrVerboseInfo(lstMap, "xrandr --verbose"); - if (Common::specialComType == Common::SpecialComputerType::NormalCom) { - std::reverse(lstMap.begin(), lstMap.end()); - } + std::sort(lstMap.begin(), lstMap.end(), [](const QMap &monintor1, const QMap &monintor2) { + if (monintor1.contains("port") && monintor2.contains("port")) + return monintor1.value("port") < monintor2.value("port"); + else + return false; + }); QList >::const_iterator it = lstMap.begin(); for (; it != lstMap.end(); ++it) { if ((*it).size() < 1)