From 7e76525f6e4678fb13ba2b1bc165ce15b91e7a6f Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Sun, 2 Apr 2023 07:34:23 +0200 Subject: [PATCH] plugins/kpackage: Call file/dir definitions without translations Depends on https://invent.kde.org/frameworks/kpackage/-/merge_requests/74 --- src/plugins/kpackage/aurorae/CMakeLists.txt | 7 +--- src/plugins/kpackage/aurorae/aurorae.cpp | 37 ++++++------------- .../kpackage/decoration/CMakeLists.txt | 7 +--- .../kpackage/decoration/decoration.cpp | 12 +++--- src/plugins/kpackage/effect/CMakeLists.txt | 7 +--- src/plugins/kpackage/effect/effect.cpp | 12 +++--- src/plugins/kpackage/scripts/CMakeLists.txt | 7 +--- src/plugins/kpackage/scripts/scripts.cpp | 12 +++--- .../kpackage/windowswitcher/CMakeLists.txt | 7 +--- .../windowswitcher/windowswitcher.cpp | 12 +++--- 10 files changed, 37 insertions(+), 83 deletions(-) diff --git a/src/plugins/kpackage/aurorae/CMakeLists.txt b/src/plugins/kpackage/aurorae/CMakeLists.txt index 7fb4bddc13..abccaf169c 100644 --- a/src/plugins/kpackage/aurorae/CMakeLists.txt +++ b/src/plugins/kpackage/aurorae/CMakeLists.txt @@ -1,9 +1,4 @@ -add_definitions(-DTRANSLATION_DOMAIN=\"kwin_package_aurorae\") - kcoreaddons_add_plugin(kwin_packagestructure_aurorae SOURCES aurorae.cpp INSTALL_NAMESPACE "kf6/packagestructure") -target_link_libraries(kwin_packagestructure_aurorae - KF6::I18n - KF6::Package -) +target_link_libraries(kwin_packagestructure_aurorae KF6::Package) set_target_properties(kwin_packagestructure_aurorae PROPERTIES OUTPUT_NAME kwin_aurorae) diff --git a/src/plugins/kpackage/aurorae/aurorae.cpp b/src/plugins/kpackage/aurorae/aurorae.cpp index 3223cbe481..2ce0b9090d 100644 --- a/src/plugins/kpackage/aurorae/aurorae.cpp +++ b/src/plugins/kpackage/aurorae/aurorae.cpp @@ -6,46 +6,33 @@ #include "aurorae.h" -#include - void AuroraePackage::initPackage(KPackage::Package *package) { package->setContentsPrefixPaths(QStringList()); package->setDefaultPackageRoot(QStringLiteral("aurorae/themes/")); - package->addFileDefinition("decoration", QStringLiteral("decoration.svgz"), - i18n("Window Decoration")); + package->addFileDefinition("decoration", QStringLiteral("decoration.svgz")); package->setRequired("decoration", true); - package->addFileDefinition("close", QStringLiteral("close.svgz"), - i18n("Close Button")); + package->addFileDefinition("close", QStringLiteral("close.svgz")); - package->addFileDefinition("minimize", QStringLiteral("minimize.svgz"), - i18n("Minimize Button")); + package->addFileDefinition("minimize", QStringLiteral("minimize.svgz")); - package->addFileDefinition("maximize", QStringLiteral("maximize.svgz"), - i18n("Maximize Button")); + package->addFileDefinition("maximize", QStringLiteral("maximize.svgz")); - package->addFileDefinition("restore", QStringLiteral("restore.svgz"), - i18n("Restore Button")); + package->addFileDefinition("restore", QStringLiteral("restore.svgz")); - package->addFileDefinition("alldesktops", QStringLiteral("alldesktops.svgz"), - i18n("Sticky Button")); + package->addFileDefinition("alldesktops", QStringLiteral("alldesktops.svgz")); - package->addFileDefinition("keepabove", QStringLiteral("keepabove.svgz"), - i18n("Keepabove Button")); + package->addFileDefinition("keepabove", QStringLiteral("keepabove.svgz")); - package->addFileDefinition("keepbelow", QStringLiteral("keepbelow.svgz"), - i18n("Keepbelow Button")); + package->addFileDefinition("keepbelow", QStringLiteral("keepbelow.svgz")); - package->addFileDefinition("shade", QStringLiteral("shade.svgz"), - i18n("Shade Button")); + package->addFileDefinition("shade", QStringLiteral("shade.svgz")); - package->addFileDefinition("help", QStringLiteral("help.svgz"), - i18n("Help Button")); + package->addFileDefinition("help", QStringLiteral("help.svgz")); - package->addFileDefinition("configrc", QStringLiteral("configrc"), - i18n("Configuration file")); + package->addFileDefinition("configrc", QStringLiteral("configrc")); QStringList mimetypes; mimetypes << QStringLiteral("image/svg+xml-compressed"); @@ -59,7 +46,7 @@ void AuroraePackage::pathChanged(KPackage::Package *package) } const QString configrc = package->metadata().pluginId() + "rc"; - package->addFileDefinition("configrc", configrc, i18n("Configuration file")); + package->addFileDefinition("configrc", configrc); } K_PLUGIN_CLASS_WITH_JSON(AuroraePackage, "kwin-packagestructure-aurorae.json") diff --git a/src/plugins/kpackage/decoration/CMakeLists.txt b/src/plugins/kpackage/decoration/CMakeLists.txt index 9168cae139..f6f65e8aee 100644 --- a/src/plugins/kpackage/decoration/CMakeLists.txt +++ b/src/plugins/kpackage/decoration/CMakeLists.txt @@ -1,9 +1,4 @@ -add_definitions(-DTRANSLATION_DOMAIN=\"kwin_package_decoration\") - kcoreaddons_add_plugin(kwin_packagestructure_decoration SOURCES decoration.cpp INSTALL_NAMESPACE "kf6/packagestructure") -target_link_libraries(kwin_packagestructure_decoration - KF6::I18n - KF6::Package -) +target_link_libraries(kwin_packagestructure_decoration KF6::Package) set_target_properties(kwin_packagestructure_decoration PROPERTIES OUTPUT_NAME kwin_decoration) diff --git a/src/plugins/kpackage/decoration/decoration.cpp b/src/plugins/kpackage/decoration/decoration.cpp index cc72c40874..39d8a8d9c7 100644 --- a/src/plugins/kpackage/decoration/decoration.cpp +++ b/src/plugins/kpackage/decoration/decoration.cpp @@ -6,22 +6,20 @@ #include "decoration.h" -#include - void DecorationPackage::initPackage(KPackage::Package *package) { package->setDefaultPackageRoot(QStringLiteral("kwin/decorations/")); - package->addDirectoryDefinition("config", QStringLiteral("config"), i18n("Configuration Definitions")); + package->addDirectoryDefinition("config", QStringLiteral("config")); QStringList mimetypes; mimetypes << QStringLiteral("text/xml"); package->setMimeTypes("config", mimetypes); - package->addDirectoryDefinition("ui", QStringLiteral("ui"), i18n("User Interface")); + package->addDirectoryDefinition("ui", QStringLiteral("ui")); - package->addDirectoryDefinition("code", QStringLiteral("code"), i18n("Executable Scripts")); + package->addDirectoryDefinition("code", QStringLiteral("code")); - package->addFileDefinition("mainscript", QStringLiteral("code/main.qml"), i18n("Main Script File")); + package->addFileDefinition("mainscript", QStringLiteral("code/main.qml")); package->setRequired("mainscript", true); mimetypes.clear(); @@ -37,7 +35,7 @@ void DecorationPackage::pathChanged(KPackage::Package *package) const QString mainScript = package->metadata().value("X-Plasma-MainScript"); if (!mainScript.isEmpty()) { - package->addFileDefinition("mainscript", mainScript, i18n("Main Script File")); + package->addFileDefinition("mainscript", mainScript); } } diff --git a/src/plugins/kpackage/effect/CMakeLists.txt b/src/plugins/kpackage/effect/CMakeLists.txt index 1df2af466b..d604b72634 100644 --- a/src/plugins/kpackage/effect/CMakeLists.txt +++ b/src/plugins/kpackage/effect/CMakeLists.txt @@ -1,9 +1,4 @@ -add_definitions(-DTRANSLATION_DOMAIN=\"kwin_package_effect\") - kcoreaddons_add_plugin(kwin_packagestructure_effect SOURCES effect.cpp INSTALL_NAMESPACE "kf6/packagestructure") -target_link_libraries(kwin_packagestructure_effect - KF6::I18n - KF6::Package -) +target_link_libraries(kwin_packagestructure_effect KF6::Package) set_target_properties(kwin_packagestructure_effect PROPERTIES OUTPUT_NAME kwin_effect) diff --git a/src/plugins/kpackage/effect/effect.cpp b/src/plugins/kpackage/effect/effect.cpp index 6e8ab0af4e..a8cf3a04c0 100644 --- a/src/plugins/kpackage/effect/effect.cpp +++ b/src/plugins/kpackage/effect/effect.cpp @@ -6,8 +6,6 @@ #include "effect.h" -#include - EffectPackageStructure::EffectPackageStructure(QObject *parent, const QVariantList &args) : KPackage::PackageStructure(parent, args) { @@ -17,16 +15,16 @@ void EffectPackageStructure::initPackage(KPackage::Package *package) { package->setDefaultPackageRoot(QStringLiteral("kwin/effects/")); - package->addDirectoryDefinition("code", QStringLiteral("code"), i18n("Executable Scripts")); + package->addDirectoryDefinition("code", QStringLiteral("code")); package->setMimeTypes("code", {QStringLiteral("text/plain")}); - package->addFileDefinition("mainscript", QStringLiteral("code/main.js"), i18n("Main Script File")); + package->addFileDefinition("mainscript", QStringLiteral("code/main.js")); package->setRequired("mainscript", true); - package->addFileDefinition("config", QStringLiteral("config/main.xml"), i18n("Configuration Definition File")); + package->addFileDefinition("config", QStringLiteral("config/main.xml")); package->setMimeTypes("config", {QStringLiteral("text/xml")}); - package->addFileDefinition("configui", QStringLiteral("ui/config.ui"), i18n("KCM User Interface File")); + package->addFileDefinition("configui", QStringLiteral("ui/config.ui")); package->setMimeTypes("configui", {QStringLiteral("text/xml")}); } @@ -41,7 +39,7 @@ void EffectPackageStructure::pathChanged(KPackage::Package *package) return; } - package->addFileDefinition("mainscript", mainScript, i18n("Main Script File")); + package->addFileDefinition("mainscript", mainScript); } K_PLUGIN_CLASS_WITH_JSON(EffectPackageStructure, "kwin-packagestructure-effect.json") diff --git a/src/plugins/kpackage/scripts/CMakeLists.txt b/src/plugins/kpackage/scripts/CMakeLists.txt index 150d7c3a7b..7e5218bcb8 100644 --- a/src/plugins/kpackage/scripts/CMakeLists.txt +++ b/src/plugins/kpackage/scripts/CMakeLists.txt @@ -1,9 +1,4 @@ -add_definitions(-DTRANSLATION_DOMAIN=\"kwin_package_scripts\") - kcoreaddons_add_plugin(kwin_packagestructure_scripts SOURCES scripts.cpp INSTALL_NAMESPACE "kf6/packagestructure") -target_link_libraries(kwin_packagestructure_scripts - KF6::I18n - KF6::Package -) +target_link_libraries(kwin_packagestructure_scripts KF6::Package) set_target_properties(kwin_packagestructure_scripts PROPERTIES OUTPUT_NAME kwin_script) diff --git a/src/plugins/kpackage/scripts/scripts.cpp b/src/plugins/kpackage/scripts/scripts.cpp index 56f7baa45f..598e00848a 100644 --- a/src/plugins/kpackage/scripts/scripts.cpp +++ b/src/plugins/kpackage/scripts/scripts.cpp @@ -6,22 +6,20 @@ #include "scripts.h" -#include - void ScriptsPackage::initPackage(KPackage::Package *package) { package->setDefaultPackageRoot(QStringLiteral("kwin/scripts/")); - package->addDirectoryDefinition("config", QStringLiteral("config"), i18n("Configuration Definitions")); + package->addDirectoryDefinition("config", QStringLiteral("config")); QStringList mimetypes; mimetypes << QStringLiteral("text/xml"); package->setMimeTypes("config", mimetypes); - package->addDirectoryDefinition("ui", QStringLiteral("ui"), i18n("User Interface")); + package->addDirectoryDefinition("ui", QStringLiteral("ui")); - package->addDirectoryDefinition("code", QStringLiteral("code"), i18n("Executable Scripts")); + package->addDirectoryDefinition("code", QStringLiteral("code")); - package->addFileDefinition("mainscript", QStringLiteral("code/main.js"), i18n("Main Script File")); + package->addFileDefinition("mainscript", QStringLiteral("code/main.js")); package->setRequired("mainscript", true); mimetypes.clear(); @@ -37,7 +35,7 @@ void ScriptsPackage::pathChanged(KPackage::Package *package) const QString mainScript = package->metadata().value("X-Plasma-MainScript"); if (!mainScript.isEmpty()) { - package->addFileDefinition("mainscript", mainScript, i18n("Main Script File")); + package->addFileDefinition("mainscript", mainScript); } } diff --git a/src/plugins/kpackage/windowswitcher/CMakeLists.txt b/src/plugins/kpackage/windowswitcher/CMakeLists.txt index 2089f9b97d..921a23a203 100644 --- a/src/plugins/kpackage/windowswitcher/CMakeLists.txt +++ b/src/plugins/kpackage/windowswitcher/CMakeLists.txt @@ -1,9 +1,4 @@ -add_definitions(-DTRANSLATION_DOMAIN=\"kwin_package_windowswitcher\") - kcoreaddons_add_plugin(kwin_packagestructure_windowswitcher SOURCES windowswitcher.cpp INSTALL_NAMESPACE "kf6/packagestructure") -target_link_libraries(kwin_packagestructure_windowswitcher - KF6::I18n - KF6::Package -) +target_link_libraries(kwin_packagestructure_windowswitcher KF6::Package) set_target_properties(kwin_packagestructure_windowswitcher PROPERTIES OUTPUT_NAME kwin_windowswitcher) diff --git a/src/plugins/kpackage/windowswitcher/windowswitcher.cpp b/src/plugins/kpackage/windowswitcher/windowswitcher.cpp index 856f87dabb..07940029c5 100644 --- a/src/plugins/kpackage/windowswitcher/windowswitcher.cpp +++ b/src/plugins/kpackage/windowswitcher/windowswitcher.cpp @@ -6,22 +6,20 @@ #include "windowswitcher.h" -#include - void SwitcherPackage::initPackage(KPackage::Package *package) { package->setDefaultPackageRoot(QStringLiteral("kwin/tabbox/")); - package->addDirectoryDefinition("config", QStringLiteral("config"), i18n("Configuration Definitions")); + package->addDirectoryDefinition("config", QStringLiteral("config")); QStringList mimetypes; mimetypes << QStringLiteral("text/xml"); package->setMimeTypes("config", mimetypes); - package->addDirectoryDefinition("ui", QStringLiteral("ui"), i18n("User Interface")); + package->addDirectoryDefinition("ui", QStringLiteral("ui")); - package->addDirectoryDefinition("code", QStringLiteral("code"), i18n("Executable windowswitcher")); + package->addDirectoryDefinition("code", QStringLiteral("code")); - package->addFileDefinition("mainscript", QStringLiteral("ui/main.qml"), i18n("Main Script File")); + package->addFileDefinition("mainscript", QStringLiteral("ui/main.qml")); package->setRequired("mainscript", true); mimetypes.clear(); @@ -37,7 +35,7 @@ void SwitcherPackage::pathChanged(KPackage::Package *package) const QString mainScript = package->metadata().value("X-Plasma-MainScript"); if (!mainScript.isEmpty()) { - package->addFileDefinition("mainscript", mainScript, i18n("Main Script File")); + package->addFileDefinition("mainscript", mainScript); } }