From a5d5f4cdedee3555ebaec8dfa5f0455cdc22af38 Mon Sep 17 00:00:00 2001 From: gongheng Date: Sat, 9 May 2026 13:24:23 +0800 Subject: [PATCH] fix(shortcuts): display correct group name for each shortcut type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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"。 --- reader/widgets/ShortCutShow.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/reader/widgets/ShortCutShow.cpp b/reader/widgets/ShortCutShow.cpp index b533df99..377421b7 100644 --- a/reader/widgets/ShortCutShow.cpp +++ b/reader/widgets/ShortCutShow.cpp @@ -61,9 +61,27 @@ void ShortCutShow::show() for(ShortCutType type : listType) { QJsonObject group; - group.insert("groupName", tr("Settings")); - QJsonArray items; + 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; + } + group.insert("groupName", strType); + QJsonArray items; for (const auto &d : m_shortcutMap[type]) { QJsonObject jsonItem; jsonItem.insert("name", d.second);