fix(DApplication): wire up applicationHomePage in about dialog - #778
fix(DApplication): wire up applicationHomePage in about dialog#77818202781743 wants to merge 2 commits into
Conversation
…dialog DApplication::handleAboutAction() previously did not call DAboutDialog::setWebsiteName/setWebsiteLink when auto-creating the about dialog, so applications could not customize the website row and always fell back to the distribution default. This change: - Wires the existing (previously dead) applicationHomePage property to DAboutDialog::setWebsiteLink, fulfilling its documented purpose. - Adds a new applicationWebsiteName property mapped to DAboutDialog::setWebsiteName for the display name. - Adds Q_PROPERTY declarations for both properties. - Both are applied only when non-empty, preserving the default distribution-fallback behavior. Closes: DDE-211
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743 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 |
Reviewer's GuideThe PR turns DApplication’s previously unused homepage setting into an effective about-dialog website link and adds an optional website display name, with non-empty overrides preserving distribution defaults and custom about-dialog instances unaffected. Sequence diagram for customized about dialog website settingssequenceDiagram
participant App as DApplication
participant Dialog as DAboutDialog
App->>App: handleAboutAction()
App->>Dialog: setWebsiteLink(applicationHomePage())
App->>Dialog: setWebsiteName(applicationWebsiteName())
Dialog-->>App: Display custom values or distribution defaults
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
… fix Per user feedback (DDE-211): do not add new API, ensure ABI compatibility, treat as bug fix. Remove the applicationWebsiteName property/methods and private member added in the previous commit. Only wire up the existing applicationHomePage() getter in handleAboutAction(): when set (non-empty), apply it to both the website link and the website display name (same value) in the about dialog. No new public API, no ABI change. Fixes DDE-211
deepin pr auto reviewAI 代码审查报告
总体评分
总体评价: 代码审查通过 代码变更简洁明确,正确地将已有的 提交目的分析
本次提交的目的是Bug 修复:将已有的 修改文件
四维度详细分析1. 语法逻辑 ✓
分析内容: 本次修改在 if (!applicationHomePage().isEmpty()) {
aboutDialog->setWebsiteLink(applicationHomePage());
aboutDialog->setWebsiteName(applicationHomePage());
}
潜在问题: 2. 代码质量 ✓
分析内容: 代码放置位置合理,紧接在 潜在问题:
改进建议:
3. 代码性能 ✓
分析内容: 本次修改为简单的属性设置操作,不涉及复杂算法或频繁系统调用,性能影响可忽略。 潜在问题:
改进建议: const QString homePage = applicationHomePage();
if (!homePage.isEmpty()) {
aboutDialog->setWebsiteLink(homePage);
aboutDialog->setWebsiteName(homePage);
}4. 代码安全 ✓
分析内容:
漏洞对比统计: 新增漏洞 0 个,减少漏洞 0 个,持平 0 个 安全漏洞详情: OCR 审查结果本次审查同步执行了 OpenCodeReview (OCR) 专业代码审查,共发现 3 个问题:
审查结论本次 PR 代码变更质量优秀,总评分 97 分。
建议: 可以合并,建议考虑上述改进建议以进一步提升用户体验。 本报告由 AI 代码审查工具自动生成 |
背景
DApplication::handleAboutAction()在自动创建关于对话框时,只设置了 productName / productIcon / version / description / license / acknowledgement,未调用DAboutDialog::setWebsiteName/setWebsiteLink,导致应用无法自定义网站行,始终回退到发行版默认值。根因
DAboutDialog本身已具备setWebsiteName()/setWebsiteLink()能力,但DApplication的自动创建路径没有接线。DApplication已有applicationHomePage/setApplicationHomePage属性,文档明确写着「主要用于在关于对话框中进行展示」,但该属性从未被handleAboutAction()读取,属于遗留死 API。方案(采用 DDE Architect 推荐方案)
复用遗留的
applicationHomePage(作为 link 源),并新增applicationWebsiteName(作为展示名称):改动文件
include/widgets/dapplication.hQ_PROPERTY(QString applicationHomePage ...)(补齐元对象一致性)Q_PROPERTY(QString applicationWebsiteName ...)applicationWebsiteName()/setApplicationWebsiteName()声明src/widgets/dapplication.cppapplicationWebsiteName()/setApplicationWebsiteName()(读写d->websiteName)handleAboutAction()自动建对话框段落,设置完 acknowledgement 后、setAttribute(WA_DeleteOnClose)前,按「非空才覆盖」插入:src/widgets/private/dapplication_p.hQString websiteName;CHANGELOG.mdapplicationWebsiteName属性applicationHomePage现生效于关于对话框向后兼容
applicationWebsiteNamegetter/setter 与Q_PROPERTY,以及为applicationHomePage补Q_PROPERTY,均为源码/二进制兼容的加法(DTK6 SONAME 线内)。applicationHomePage和applicationWebsiteName时,两个if (!...isEmpty())均不触发,对话框仍显示发行版默认网站。applicationHomePage从死代码变为生效:变更方向符合其文档一直承诺的用途;唯一受影响的是「调用了setApplicationHomePage却期望它什么都不做」的极端组合,实际中几乎不存在。setAboutDialog()传入的对话框不走新逻辑。测试建议
新增用例覆盖 4 个组合:
并回归:
setAboutDialog自定义对话框不受影响关联
Summary by Sourcery
Bug Fixes: