Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions deepin-devicemanager/src/DeviceManager/DeviceManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;...
}
Expand Down
6 changes: 4 additions & 2 deletions deepin-devicemanager/src/DeviceManager/DevicePower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ bool DevicePower::setInfoFromUpower(const QMap<QString, QString> &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;
}
Expand Down Expand Up @@ -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()
Expand Down
13 changes: 10 additions & 3 deletions deepin-devicemanager/src/Tool/ThreadExecXrandr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ void ThreadExecXrandr::loadXrandrVerboseInfo(QList<QMap<QString, QString>> &lstM
// 新的显示屏
QMap<QString, QString> 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;
}
Expand Down Expand Up @@ -276,9 +280,12 @@ void ThreadExecXrandr::getMonitorInfoFromXrandrVerbose()

QList<QMap<QString, QString>> 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<QString, QString> &monintor1, const QMap<QString, QString> &monintor2) {
if (monintor1.contains("port") && monintor2.contains("port"))
return monintor1.value("port") < monintor2.value("port");
else
return false;
});
QList<QMap<QString, QString> >::const_iterator it = lstMap.begin();
for (; it != lstMap.end(); ++it) {
if ((*it).size() < 1)
Expand Down