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
3 changes: 2 additions & 1 deletion deepin-devicemanager/src/DeviceManager/DeviceCpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ void DeviceCpu::setCpuInfo(const QMap<QString, QString> &mapLscpu, const QMap<QS

if (Common::specialComType == Common::kSpecialType5 ||
Common::specialComType == Common::kSpecialType6 ||
Common::specialComType == Common::kSpecialType7) {
Common::specialComType == Common::kSpecialType7 ||
Common::specialComType == Common::kSpecialType9) {
m_Frequency = m_Frequency.replace("2.189", "2.188");
m_MaxFrequency = m_MaxFrequency.replace("2189", "2188");
}
Expand Down
26 changes: 19 additions & 7 deletions deepin-devicemanager/src/DeviceManager/DeviceMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void DeviceMonitor::setInfoFromHwinfo(const QMap<QString, QString> &mapInfo)

TomlFixMethod DeviceMonitor::setInfoFromTomlOneByOne(const QMap<QString, QString> &mapInfo)
{
if (Common::specialComType == 2)
if (Common::specialComType == Common::kSpecialType2)
m_IsTomlSet = true;
TomlFixMethod ret = TOML_None;
// 添加基本信息
Expand Down Expand Up @@ -299,7 +299,9 @@ QString DeviceMonitor::subTitle()
const QString DeviceMonitor::getOverviewInfo()
{
QString ov;
if (Common::specialComType == 6 || Common::specialComType == 7) {
if (Common::specialComType == Common::kSpecialType6 ||
Common::specialComType == Common::kSpecialType7 ||
Common::specialComType == Common::kSpecialType9) {
ov = QString("(%1)").arg(m_ScreenSize);
} else {
ov = QString("%1(%2)").arg(m_Name).arg(m_ScreenSize);
Expand All @@ -316,7 +318,10 @@ void DeviceMonitor::initFilterKey()
void DeviceMonitor::loadBaseDeviceInfo()
{
// 添加基本信息
if (Common::specialComType != 6 && Common::specialComType != 5 && Common::specialComType != 7) {
if (Common::specialComType != Common::kSpecialType5 &&
Common::specialComType != Common::kSpecialType6 &&
Common::specialComType != Common::kSpecialType7 &&
Common::specialComType != Common::kSpecialType9) {
addBaseDeviceInfo(("Name"), m_Name);
addBaseDeviceInfo(("Vendor"), m_Vendor);
addBaseDeviceInfo(("Type"), m_Model);
Expand All @@ -334,7 +339,7 @@ void DeviceMonitor::loadOtherDeviceInfo()
addOtherDeviceInfo(("Current Resolution"), m_CurrentResolution);
addOtherDeviceInfo(("Display Ratio"), m_AspectRatio);

if (Common::specialComType == 4) {
if (Common::specialComType == Common::kSpecialType4) {
if (m_CurrentResolution.contains("@")) {
QStringList refreshList = m_CurrentResolution.split('@', QString::SkipEmptyParts);
if (refreshList.size() == 2) {
Expand Down Expand Up @@ -391,16 +396,23 @@ bool DeviceMonitor::setMainInfoFromXrandr(const QString &info, const QString &ra
QRegExp rateStart("[a-zA-Z]");
int pos = curRate.indexOf(rateStart);
if (pos > 0 && curRate.size() > pos && !Common::boardVendorType().isEmpty()) {
if (Common::specialComType == 1) {
if (Common::specialComType == Common::kSpecialType1) {
curRate = QString::number(ceil(curRate.left(pos).toDouble())) + ".00" + curRate.right(curRate.size() - pos);
} else {
curRate = QString::number(ceil(curRate.left(pos).toDouble())) + curRate.right(curRate.size() - pos);
}
}
if (Common::specialComType == 1 || Common::specialComType == 5 || Common::specialComType == 6 || Common::specialComType == 7) {
if (Common::specialComType == Common::kSpecialType1 ||
Common::specialComType == Common::kSpecialType5 ||
Common::specialComType == Common::kSpecialType6 ||
Common::specialComType == Common::kSpecialType7 ||
Common::specialComType == Common::kSpecialType9) {
m_RefreshRate = QString("%1").arg(curRate);
}
if (Common::specialComType == 5 || Common::specialComType == 6 || Common::specialComType == 7) {
if (Common::specialComType == Common::kSpecialType5 ||
Common::specialComType == Common::kSpecialType6 ||
Common::specialComType == Common::kSpecialType7 ||
Common::specialComType == Common::kSpecialType9) {
m_CurrentResolution = QString("%1").arg(reScreenSize.cap(1)).replace("x", "×", Qt::CaseInsensitive);
} else {
m_CurrentResolution = QString("%1 @%2").arg(reScreenSize.cap(1)).arg(curRate).replace("x", "×", Qt::CaseInsensitive);
Expand Down
2 changes: 1 addition & 1 deletion deepin-devicemanager/src/GenerateDevice/HWGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void HWGenerator::generatorDiskDevice()
if (name.contains("SDINFDO4-256G",Qt::CaseInsensitive))
tempMap["Name"] = "nouse";

if (Common::specialComType == 2) {
if (Common::specialComType == Common::kSpecialType2) {
tempMap["Interface"] = "UFS";
}

Expand Down
12 changes: 6 additions & 6 deletions deepin-devicemanager/src/commonfunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,22 +124,22 @@ QString Common::checkBoardVendorFlag()
case NormalCom:
boardVendorKey = "";
break;
case PGUW:
case kSpecialType1:
boardVendorKey = "PGUW";
break;
case KLVV:
case kSpecialType2:
boardVendorKey = "KLVV";
break;
case KLVU:
case kSpecialType3:
boardVendorKey = "KLVU";
break;
case PGUV:
case kSpecialType4:
boardVendorKey = "PGUV";
break;
case kSpecialType5:
boardVendorKey = "PGUX";
break;
case kCustomType:
case kSpecialType8:
boardVendorKey = "CustomType";
break;
default:
Expand Down Expand Up @@ -209,7 +209,7 @@ void Common::tomlFilesNameSet(const QString &name)

bool Common::isHwPlatform()
{
if (specialComType == Unknow || specialComType == NormalCom || specialComType == kCustomType)
if (specialComType == Unknow || specialComType == NormalCom || specialComType == kSpecialType8)
return false;
return true;
}
Expand Down
11 changes: 6 additions & 5 deletions deepin-devicemanager/src/commonfunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ class Common
enum SpecialComputerType{
Unknow = -1,
NormalCom,
PGUW,
KLVV,
KLVU,
PGUV,
kSpecialType1,
kSpecialType2,
kSpecialType3,
kSpecialType4,
kSpecialType5,
kSpecialType6,
kSpecialType7,
kCustomType
kSpecialType8,
kSpecialType9
};

enum SpecialCpuType {
Expand Down
2 changes: 1 addition & 1 deletion deepin-devicemanager/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ int main(int argc, char *argv[])
}

// 特殊机型,提前缓存GPU信息
if (Common::specialComType == Common::kCustomType && !CommonTools::hasPciGraphicsCard()) {
if (Common::specialComType == Common::kSpecialType8 && !CommonTools::hasPciGraphicsCard()) {
CommonTools::preGenerateGpuInfo();
}

Expand Down