fix(shortcuts): display correct group name for each shortcut type#273
Merged
deepin-bot[bot] merged 1 commit intoMay 9, 2026
Merged
Conversation
Replace hardcoded "Settings" group name with type-specific names (Settings, File, Display, Tools, Edit) based on ShortCutType enum. 修复快捷键分组名称硬编码为"Settings"的bug,根据ShortCutType枚举 正确显示对应的分组名称。 Log: 修复快捷键分组名称显示错误 Bug: https://pms.uniontech.com/bug-view-354843.html Influence: 快捷键列表中各分组将显示正确的名称,不再统一显示为"Settings"。
bc38e8d to
9497ff4
Compare
deepin pr auto review这段代码主要修改了版权声明年份,并重构了快捷键显示逻辑,将原本硬编码的 "Settings" 改为了根据 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
5. 改进建议以下是改进后的代码示例: QString strType;
switch (type) {
case ShortCutType::Settings: strType = tr("Settings"); break;
case ShortCutType::File: strType = tr("File"); break;
case ShortCutType::Display: strType = tr("Display"); break;
case ShortCutType::Tools: strType = tr("Tools"); break;
case ShortCutType::Edit: strType = tr("Edit"); break;
default: strType = tr("Unknown"); break; // 添加默认分支
}
group.insert("groupName", strType);
QJsonArray items;
items.reserve(m_shortcutMap[type].size()); // 预分配容量
for (const auto &d : m_shortcutMap[type]) {
QJsonObject jsonItem;
jsonItem.insert("name", d.second);
jsonItem.insert("value", d.first);
items.append(jsonItem);
}
group.insert("groupItems", items);6. 其他建议
总结这段代码的逻辑是正确的,但可以通过添加 |
max-lvs
approved these changes
May 9, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: GongHeng2017, max-lvs 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
Author
|
/merge |
Contributor
|
This pr cannot be merged! (status: unstable) |
Contributor
Author
|
/forcemerge |
Contributor
|
This pr force merged! (status: unstable) |
9f169f7
into
linuxdeepin:release/eagle
7 of 9 checks passed
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.
Replace hardcoded "Settings" group name with type-specific names (Settings, File, Display, Tools, Edit) based on ShortCutType enum.
修复快捷键分组名称硬编码为"Settings"的bug,根据ShortCutType枚举
正确显示对应的分组名称。
Log: 修复快捷键分组名称显示错误
Bug: https://pms.uniontech.com/bug-view-354843.html
Influence: 快捷键列表中各分组将显示正确的名称,不再统一显示为"Settings"。