Skip to content

Commit 4537dae

Browse files
robertkilldeepin-bot[bot]
authored andcommitted
fix: pass control center help fallback candidates
1. Collect the active control center navigation object chain when opening help 2. Reuse the NavigationModel-style filter so only menu objects with display names are used as help candidates 3. Pass the ordered candidates to deepin-manual so child pages without sections can fall back to a parent topic Influence: 1. Test help on input method add-ons to fall back to the input method topic 2. Verify shortcut and network child pages still open mapped manual sections 3. Verify the final debug-machine package contains no unrelated desktop file changes fix: 控制中心帮助跳转传递父级候选链 1. 打开帮助时收集当前控制中心导航对象链 2. 复用 NavigationModel 风格过滤,只使用带显示名称的菜单对象作为帮助候选项 3. 传递有序候选列表,使没有手册章节的子页面可以回退到父级主题 Influence: 1. 测试输入法附加组件帮助可回退到输入法主题 2. 验证快捷键和网络子页面仍可打开对应手册章节 3. 验证最终调试机包不包含无关 desktop 文件改动 PMS: BUG-368805
1 parent a756767 commit 4537dae

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

src/dde-control-center/dccmanager.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,19 @@ QWindow *DccManager::mainWindow() const
319319

320320
void DccManager::showHelp()
321321
{
322-
QString helpTitle;
323-
if (1 < m_currentObjects.count())
324-
helpTitle = m_currentObjects.last()->name();
325-
if (helpTitle.isEmpty())
326-
helpTitle = "controlcenter";
322+
QStringList helpTitles;
323+
for (auto it = m_currentObjects.crbegin(); it != m_currentObjects.crend(); ++it) {
324+
DccObject *object = *it;
325+
if (!object || object == m_root)
326+
continue;
327+
328+
if (!(object->pageType() & DccObject::PageType::Menu) || object->displayName().isEmpty())
329+
continue;
330+
331+
helpTitles.append(object->name());
332+
}
333+
334+
const QString helpTitle = helpTitles.isEmpty() ? QStringLiteral("controlcenter") : helpTitles.join(QChar(0x1f));
327335

328336
const QString &dmanInterface = "com.deepin.Manual.Open";
329337
QDBusMessage message = QDBusMessage::createMethodCall(dmanInterface, "/com/deepin/Manual/Open", dmanInterface, "OpenTitle");

0 commit comments

Comments
 (0)