Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Use KAboutData to fill the official application info
Dmitry Kazakov5b5eccbc6bfc
diff --git a/libs/ui/KisApplication.cpp b/libs/ui/KisApplication.cppindex e737afa0b0..bae74d4c5a 100644--- a/libs/ui/KisApplication.cpp+++ b/libs/ui/KisApplication.cpp@@ -44,6 +44,7 @@#include <kdesktopfile.h>#include <kconfig.h>#include <kconfiggroup.h>+#include <kaboutdata.h>#include <KoDockRegistry.h>#include <KoToolRegistry.h>@@ -216,7 +217,6 @@ public:int m_fileCount;};-KisApplication::KisApplication(const QString &key, int &argc, char **argv): QtSingleApplication(key, argc, argv), d(new Private)@@ -233,14 +233,32 @@ KisApplication::KisApplication(const QString &key, int &argc, char **argv)QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath());- setApplicationDisplayName("Krita");- setApplicationName("krita");- // Note: Qt docs suggest we set this, but if we do, we get resource paths of the form of krita/krita, which is weird.- // setOrganizationName("krita");- setOrganizationDomain("krita.org");+ {+ /// Initialize application info, it will be used by both, Qt and+ /// DrKonqi of the host system++ KAboutData aboutData("krita",+ "Krita",+ KritaVersionWrapper::versionString(true),+ "", // TODO: "short description" needs new string exception+ KAboutLicense::GPL,+ i18nc("@info:credit", "© 1999–2026 The Krita Developers"));+ aboutData.setHomepage(QStringLiteral("https://krita.org"));+ aboutData.setOrganizationDomain("krita.org");+ // Have to explicitly set the bug address since the kde api now sets it to null by default+ // https://invent.kde.org/frameworks/kcoreaddons/-/commit/3324b59b+ aboutData.setBugAddress("[email protected]");++ // this call sets corresponding fields of QApplication as well+ KAboutData::setApplicationData(aboutData);++ // Note: Qt docs suggest we set organization name, but if we do, we get resource+ // paths of the form of krita/krita, which is weird.+ KIS_SAFE_ASSERT_RECOVER(this->organizationName().isEmpty()) {+ this->setOrganizationName("");+ }+ }- QString version = KritaVersionWrapper::versionString(true);- setApplicationVersion(version);#ifndef Q_OS_MACOSsetWindowIcon(KisIconUtils::loadIcon("krita-branding"));#endifdiff --git a/libs/ui/KisMainWindow.cpp b/libs/ui/KisMainWindow.cppindex 2d8b859ccf..76273df177 100644--- a/libs/ui/KisMainWindow.cpp+++ b/libs/ui/KisMainWindow.cpp@@ -516,14 +516,7 @@ KisMainWindow::KisMainWindow(QUuid uuid)updateWindowMenu();if (isHelpMenuEnabled() && !d->helpMenu) {- QGuiApplication *app = qApp;- KAboutData aboutData(KAboutData::applicationData());- aboutData.setOrganizationDomain(app->organizationDomain().toUtf8());- //Have to explicitly set the bug address since the kde api now sets it to null by default- //https://invent.kde.org/frameworks/kcoreaddons/-/commit/3324b59b- aboutData.setBugAddress("[email protected]");-- d->helpMenu = new KisKHelpMenu(this, aboutData, false);+ d->helpMenu = new KisKHelpMenu(this, KAboutData::applicationData(), false);// workaround-less version:// d->helpMenu = new KisKHelpMenu(this, QString()/*unused*/, false);diff --git a/libs/ui/dialogs/kis_about_application.cpp b/libs/ui/dialogs/kis_about_application.cppindex 827a1ea97d..a23eb246c3 100644--- a/libs/ui/dialogs/kis_about_application.cpp+++ b/libs/ui/dialogs/kis_about_application.cpp@@ -60,6 +60,7 @@ KisAboutApplication::KisAboutApplication(QWidget *parent)wdgTab->lblAuthors->setText(authors);// Translators+ // TODO: move to KisApplication after string freeze is liftedKAboutData aboutData(KAboutData::applicationData());if (aboutData.translators().isEmpty()) {aboutData.setTranslator(i18nc("NAME OF TRANSLATORS", "Your names"),