fix: Information time display in English#1459
Merged
deepin-bot[bot] merged 2 commits intolinuxdeepin:masterfrom Mar 2, 2026
Merged
fix: Information time display in English#1459deepin-bot[bot] merged 2 commits intolinuxdeepin:masterfrom
deepin-bot[bot] merged 2 commits intolinuxdeepin:masterfrom
Conversation
deepin pr auto review这段代码的修改主要是为了解决日期时间显示的本地化问题。下面是对这段 diff 的详细审查和改进建议: 1. 代码逻辑审查优点:
潜在问题:
2. 代码质量审查建议:
3. 代码性能审查分析:
4. 代码安全审查分析:
5. 改进后的代码建议void AppNotifyItem::updateTime()
{
// 缓存系统区域设置,避免重复查询
static const QLocale systemLocale = QLocale::system();
// ... (之前的代码保持不变)
} else if (elapsedDay >= 2 && elapsedDay < 7) {
// 显示星期几和时间 (例如: "周一 14:30")
ret = systemLocale.toString(time, "ddd hh:mm");
} else {
// 显示短日期格式 (例如: "2023/12/25")
// 注意:如果需要显示时间,应修改格式字符串
ret = systemLocale.toString(time, systemLocale.dateFormat(QLocale::ShortFormat));
}
}6. 其他建议
这些改进可以提高代码的可读性、性能和可维护性,同时确保在不同区域设置下都能正确显示日期时间。 |
18202781743
approved these changes
Feb 28, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, JWWTSL The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
|
copyright的时间改一下, |
Contributor
Author
|
/forcemerge |
|
This pr force merged! (status: unstable) |
log: Optimised display logic pms: bug-350589
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
log: Optimised display logic
pms: bug-350589