diff --git a/deepin-devicemanager/src/DeviceManager/DeviceStorage.cpp b/deepin-devicemanager/src/DeviceManager/DeviceStorage.cpp index dfd91d3f..c35579c5 100644 --- a/deepin-devicemanager/src/DeviceManager/DeviceStorage.cpp +++ b/deepin-devicemanager/src/DeviceManager/DeviceStorage.cpp @@ -213,12 +213,8 @@ bool DeviceStorage::setHwinfoInfo(const QMap &mapInfo) QFile file(Path); if (file.open(QIODevice::ReadOnly)) { QString output = file.readAll(); - if (output.contains("310", Qt::CaseInsensitive)) { - m_Interface = "UFS 3.1"; - } else if (output.contains("300", Qt::CaseInsensitive)) { - m_Interface = "UFS 3.0"; - } else if (output.contains("400", Qt::CaseInsensitive)) { - m_Interface = "UFS 4.0"; + if (!output.isEmpty()) { + m_Interface = "UFS"; } file.close(); } diff --git a/deepin-devicemanager/src/GenerateDevice/HWGenerator.cpp b/deepin-devicemanager/src/GenerateDevice/HWGenerator.cpp index 79267176..d03cda59 100644 --- a/deepin-devicemanager/src/GenerateDevice/HWGenerator.cpp +++ b/deepin-devicemanager/src/GenerateDevice/HWGenerator.cpp @@ -281,7 +281,7 @@ void HWGenerator::generatorDiskDevice() tempMap["Name"] = "nouse"; if (Common::specialComType == 2) { - tempMap["Interface"] = "UFS 3.1"; + tempMap["Interface"] = "UFS"; } // 读取interface版本 @@ -297,10 +297,10 @@ void HWGenerator::generatorDiskDevice() exitCode = process.exitCode(); if (exitCode != 127 && exitCode != 126) { deviceInfo = process.readAllStandardOutput(); - if (deviceInfo.trimmed() == "310") { - tempMap["interface"] = "UFS 3.1"; - } else if (deviceInfo.trimmed() == "300") - tempMap["interface"] = "UFS 3.0"; + + if (!deviceInfo.trimmed().isEmpty()) { + tempMap["interface"] = "UFS"; + } } } }