-
Notifications
You must be signed in to change notification settings - Fork 40
pick develop/eagle to master #560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ad28175
56fbfc0
0d15903
5f2220e
c58b355
4b0cdb8
df89403
dabcbfc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,7 +152,9 @@ bool DeviceStorage::setHwinfoInfo(const QMap<QString, QString> &mapInfo) | |
| return false; | ||
| } | ||
|
|
||
| setAttribute(mapInfo, "Model", m_Name); | ||
| if (Common::specialComType <= 0) { | ||
| setAttribute(mapInfo, "Model", m_Name); | ||
| } | ||
| setAttribute(mapInfo, "Vendor", m_Vendor); | ||
|
|
||
| // 希捷硬盘为ATA硬盘,无法直接获取厂商信息,只能特殊处理 | ||
|
|
@@ -520,21 +522,22 @@ void DeviceStorage::appendDisk(DeviceStorage *device) | |
| void DeviceStorage::checkDiskSize() | ||
| { | ||
| qCDebug(appLog) << "DeviceStorage::checkDiskSize"; | ||
| if (Common::specialVendorType() != Common::specialHString()) { | ||
| if (Common::specialComType <= 0) { | ||
| return; //定制机型专用,其它慎用 | ||
| } | ||
| quint64 gbyte = 1000000000; | ||
| if (m_Interface.contains("UFS", Qt::CaseInsensitive)) { | ||
| if (m_SizeBytes > 255*gbyte && m_SizeBytes < 257*gbyte) { | ||
| m_Size = "256 GB"; | ||
| } else if (m_SizeBytes > 511*gbyte && m_SizeBytes < 513*gbyte) { | ||
| m_Size = "512 GB"; | ||
| } else if (m_SizeBytes > 999*gbyte && m_SizeBytes < 1025*gbyte) { | ||
| m_Size = "1 TB"; | ||
| } else if (m_SizeBytes > 1999*gbyte && m_SizeBytes < 2049*gbyte) { | ||
| m_Size = "2 TB"; | ||
| } | ||
| } | ||
|
|
||
| // if (m_Interface.contains("UFS", Qt::CaseInsensitive)) { // TODO Ignore ufs disk | ||
| if (m_SizeBytes > 255*gbyte && m_SizeBytes < 257*gbyte) { | ||
| m_Size = "256 GB"; | ||
| } else if (m_SizeBytes > 511*gbyte && m_SizeBytes < 513*gbyte) { | ||
| m_Size = "512 GB"; | ||
| } else if (m_SizeBytes > 999*gbyte && m_SizeBytes < 1025*gbyte) { | ||
| m_Size = "1 TB"; | ||
| } else if (m_SizeBytes > 1999*gbyte && m_SizeBytes < 2049*gbyte) { | ||
| m_Size = "2 TB"; | ||
| } | ||
| // } | ||
| if (m_Interface.contains("USB", Qt::CaseInsensitive)) { | ||
| if (m_SizeBytes > 15*gbyte && m_SizeBytes < 17*gbyte) { | ||
| m_Size = "16 GB"; | ||
|
|
@@ -615,7 +618,21 @@ QString DeviceStorage::subTitle() | |
| const QString DeviceStorage::getOverviewInfo() | ||
| { | ||
| // qCDebug(appLog) << "DeviceStorage::getOverviewInfo"; | ||
| return QString("%1 (%2)").arg(m_Name).arg(m_Size);; | ||
| QString overViewInfo = QString("%1 (%2)").arg(m_Name).arg(m_Size); | ||
|
|
||
| // 见内网gerrit项目 os-config 中机型的 specialComType , 示例配置文件位置如下: | ||
| // os-config/hardware/机型/etc/dsg/configs/overrides/org.deepin.devicemanager/org.deepin.devicemanager/4000-org.deepin.devicemanager.override.json | ||
| if (Common::specialComType == 5){ | ||
| if (m_Interface.contains("UFS", Qt::CaseInsensitive)) { | ||
| overViewInfo = QString("%1 %2").arg(m_Size).arg("UFS"); | ||
| } else if (m_Interface.contains("USB", Qt::CaseInsensitive)) { | ||
| overViewInfo = QString("%1 %2").arg(m_Size).arg("USB"); | ||
| } else { | ||
| overViewInfo = QString("%1 %2").arg(m_Size).arg(m_MediaType); | ||
| } | ||
| } | ||
|
|
||
|
Comment on lines
+625
to
+634
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Consider using i18n for media/interface tokens in the overview string or aligning them with existing localization. In the Suggested implementation: if (Common::specialComType == 5) {
// Use translated labels for interface types to avoid mixing localized and English text
const QString ufsLabel = tr("UFS");
const QString usbLabel = tr("USB");
if (m_Interface.contains("UFS", Qt::CaseInsensitive)) {
overViewInfo = QString("%1 %2").arg(m_Size, ufsLabel);
} else if (m_Interface.contains("USB", Qt::CaseInsensitive)) {
overViewInfo = QString("%1 %2").arg(m_Size, usbLabel);
} else {
overViewInfo = QString("%1 %2").arg(m_Size, m_MediaType);
}
}
return overViewInfo;
|
||
| return overViewInfo; | ||
| } | ||
|
|
||
| void DeviceStorage::initFilterKey() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -276,7 +276,7 @@ void ThreadExecXrandr::getMonitorInfoFromXrandrVerbose() | |
|
|
||
| QList<QMap<QString, QString>> lstMap; | ||
| loadXrandrVerboseInfo(lstMap, "xrandr --verbose"); | ||
|
|
||
| std::reverse(lstMap.begin(), lstMap.end()); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question (bug_risk): Reversing This change makes the first monitor processed in |
||
| QList<QMap<QString, QString> >::const_iterator it = lstMap.begin(); | ||
| for (; it != lstMap.end(); ++it) { | ||
| if ((*it).size() < 1) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question (performance): Increasing the select timeout to 1s may introduce noticeable delay for USB hotplug handling.
The timeout has changed from 10ms to 1s, which reduces wakeups and CPU usage but can delay USB event handling by up to 1s. To balance responsiveness and resource usage, consider a smaller value (e.g., 100–200ms) or making the timeout configurable.