From eaf47e3cecea49e003f7c17e0a398e33d4885d40 Mon Sep 17 00:00:00 2001 From: multica-bot <18202781743@users.noreply.github.com> Date: Tue, 1 Sep 2026 15:30:33 +0800 Subject: [PATCH 1/2] feat(DApplication): allow customizing website name/link in the about 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 --- CHANGELOG.md | 13 +++++++++++++ include/widgets/dapplication.h | 5 +++++ src/widgets/dapplication.cpp | 27 +++++++++++++++++++++++++++ src/widgets/private/dapplication_p.h | 1 + 4 files changed, 46 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0da4ca486..69ae1921c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Added + +- Add `applicationWebsiteName` property to `DApplication` for customizing the + website display name shown in the about dialog. + +### Changed + +- `DApplication::applicationHomePage` is now applied to the about dialog's + website link (previously a no-op dead API). It now fulfills its documented + purpose of being shown in the about dialog. + ## [6.7.48] - 2026-08-18 ### Fixed diff --git a/include/widgets/dapplication.h b/include/widgets/dapplication.h index a7d940b29..282a1a8be 100644 --- a/include/widgets/dapplication.h +++ b/include/widgets/dapplication.h @@ -40,6 +40,8 @@ class LIBDTKWIDGETSHARED_EXPORT DApplication : public QApplication, public DTK_C Q_PROPERTY(QString applicationCreditsFile READ applicationCreditsFile WRITE setApplicationCreditsFile) Q_PROPERTY(QByteArray applicationCreditsContent READ applicationCreditsContent WRITE setApplicationCreditsContent) Q_PROPERTY(QString licensePath READ licensePath WRITE setLicensePath) + Q_PROPERTY(QString applicationHomePage READ applicationHomePage WRITE setApplicationHomePage) + Q_PROPERTY(QString applicationWebsiteName READ applicationWebsiteName WRITE setApplicationWebsiteName) public: static DApplication *globalApplication(int &argc, char **argv); @@ -98,6 +100,9 @@ class LIBDTKWIDGETSHARED_EXPORT DApplication : public QApplication, public DTK_C QString applicationHomePage() const; void setApplicationHomePage(const QString &link); + QString applicationWebsiteName() const; + void setApplicationWebsiteName(const QString &name); + QString applicationAcknowledgementPage() const; void setApplicationAcknowledgementPage(const QString &link); diff --git a/src/widgets/dapplication.cpp b/src/widgets/dapplication.cpp index 12adc27bb..387e26b7e 100644 --- a/src/widgets/dapplication.cpp +++ b/src/widgets/dapplication.cpp @@ -1012,6 +1012,27 @@ void DApplication::setApplicationHomePage(const QString &link) d->homePage = link; } +/*! + \brief 程序的主页展示名称。 + + 该属性记录程序主页在关于对话框中展示的名称。 + 留空时,关于对话框将回退到发行版默认的网站名称。 + 建议与 applicationHomePage 同时设置,以保证展示名称与链接一致。 + */ +QString DApplication::applicationWebsiteName() const +{ + D_DC(DApplication); + + return d->websiteName; +} + +void DApplication::setApplicationWebsiteName(const QString &name) +{ + D_D(DApplication); + + d->websiteName = name; +} + /*! \brief returns the acknowlegement page of the application. \brief 记录程序的鸣谢信息网址,主要用于在关于对话框中进行展示. @@ -1450,6 +1471,12 @@ void DApplication::handleAboutAction() aboutDialog->setAcknowledgementLink(applicationAcknowledgementPage()); } #endif + if (!applicationHomePage().isEmpty()) { + aboutDialog->setWebsiteLink(applicationHomePage()); + } + if (!applicationWebsiteName().isEmpty()) { + aboutDialog->setWebsiteName(applicationWebsiteName()); + } aboutDialog->setAcknowledgementVisible(d->acknowledgementPageVisible); aboutDialog->setAttribute(Qt::WA_DeleteOnClose); diff --git a/src/widgets/private/dapplication_p.h b/src/widgets/private/dapplication_p.h index 5549a5602..851555e22 100644 --- a/src/widgets/private/dapplication_p.h +++ b/src/widgets/private/dapplication_p.h @@ -65,6 +65,7 @@ class DApplicationPrivate : public DObjectPrivate QString appLicense; QString appDescription; QString homePage; + QString websiteName; QString acknowledgementPage; QString applicationCreditsFile; QByteArray applicationCreditsContent; From ec09c1cd8a7727c7b53b776b7f9bf55473a168a3 Mon Sep 17 00:00:00 2001 From: multica-bot <18202781743@users.noreply.github.com> Date: Wed, 2 Sep 2026 11:09:13 +0800 Subject: [PATCH 2/2] fix(DApplication): wire up applicationHomePage in about dialog as bug 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 --- CHANGELOG.md | 10 +++------- include/widgets/dapplication.h | 5 ----- src/widgets/dapplication.cpp | 25 +------------------------ src/widgets/private/dapplication_p.h | 1 - 4 files changed, 4 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69ae1921c..ac9a86ec7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,16 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -### Added - -- Add `applicationWebsiteName` property to `DApplication` for customizing the - website display name shown in the about dialog. - -### Changed +### Fixed - `DApplication::applicationHomePage` is now applied to the about dialog's website link (previously a no-op dead API). It now fulfills its documented - purpose of being shown in the about dialog. + purpose of being shown in the about dialog. When set, the website display + name shown in the about dialog is the same as the link. ## [6.7.48] - 2026-08-18 diff --git a/include/widgets/dapplication.h b/include/widgets/dapplication.h index 282a1a8be..a7d940b29 100644 --- a/include/widgets/dapplication.h +++ b/include/widgets/dapplication.h @@ -40,8 +40,6 @@ class LIBDTKWIDGETSHARED_EXPORT DApplication : public QApplication, public DTK_C Q_PROPERTY(QString applicationCreditsFile READ applicationCreditsFile WRITE setApplicationCreditsFile) Q_PROPERTY(QByteArray applicationCreditsContent READ applicationCreditsContent WRITE setApplicationCreditsContent) Q_PROPERTY(QString licensePath READ licensePath WRITE setLicensePath) - Q_PROPERTY(QString applicationHomePage READ applicationHomePage WRITE setApplicationHomePage) - Q_PROPERTY(QString applicationWebsiteName READ applicationWebsiteName WRITE setApplicationWebsiteName) public: static DApplication *globalApplication(int &argc, char **argv); @@ -100,9 +98,6 @@ class LIBDTKWIDGETSHARED_EXPORT DApplication : public QApplication, public DTK_C QString applicationHomePage() const; void setApplicationHomePage(const QString &link); - QString applicationWebsiteName() const; - void setApplicationWebsiteName(const QString &name); - QString applicationAcknowledgementPage() const; void setApplicationAcknowledgementPage(const QString &link); diff --git a/src/widgets/dapplication.cpp b/src/widgets/dapplication.cpp index 387e26b7e..106e8daa7 100644 --- a/src/widgets/dapplication.cpp +++ b/src/widgets/dapplication.cpp @@ -1012,27 +1012,6 @@ void DApplication::setApplicationHomePage(const QString &link) d->homePage = link; } -/*! - \brief 程序的主页展示名称。 - - 该属性记录程序主页在关于对话框中展示的名称。 - 留空时,关于对话框将回退到发行版默认的网站名称。 - 建议与 applicationHomePage 同时设置,以保证展示名称与链接一致。 - */ -QString DApplication::applicationWebsiteName() const -{ - D_DC(DApplication); - - return d->websiteName; -} - -void DApplication::setApplicationWebsiteName(const QString &name) -{ - D_D(DApplication); - - d->websiteName = name; -} - /*! \brief returns the acknowlegement page of the application. \brief 记录程序的鸣谢信息网址,主要用于在关于对话框中进行展示. @@ -1473,9 +1452,7 @@ void DApplication::handleAboutAction() #endif if (!applicationHomePage().isEmpty()) { aboutDialog->setWebsiteLink(applicationHomePage()); - } - if (!applicationWebsiteName().isEmpty()) { - aboutDialog->setWebsiteName(applicationWebsiteName()); + aboutDialog->setWebsiteName(applicationHomePage()); } aboutDialog->setAcknowledgementVisible(d->acknowledgementPageVisible); aboutDialog->setAttribute(Qt::WA_DeleteOnClose); diff --git a/src/widgets/private/dapplication_p.h b/src/widgets/private/dapplication_p.h index 851555e22..5549a5602 100644 --- a/src/widgets/private/dapplication_p.h +++ b/src/widgets/private/dapplication_p.h @@ -65,7 +65,6 @@ class DApplicationPrivate : public DObjectPrivate QString appLicense; QString appDescription; QString homePage; - QString websiteName; QString acknowledgementPage; QString applicationCreditsFile; QByteArray applicationCreditsContent;