plugins/kpackage: Call file/dir definitions without translations

Depends on https://invent.kde.org/frameworks/kpackage/-/merge_requests/74
This commit is contained in:
Alexander Lohnau 2023-04-02 07:34:23 +02:00
parent 6a93514220
commit 7e76525f6e
10 changed files with 37 additions and 83 deletions

View file

@ -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)

View file

@ -6,46 +6,33 @@
#include "aurorae.h"
#include <KLocalizedString>
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")

View file

@ -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)

View file

@ -6,22 +6,20 @@
#include "decoration.h"
#include <KLocalizedString>
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);
}
}

View file

@ -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)

View file

@ -6,8 +6,6 @@
#include "effect.h"
#include <KLocalizedString>
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")

View file

@ -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)

View file

@ -6,22 +6,20 @@
#include "scripts.h"
#include <KLocalizedString>
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);
}
}

View file

@ -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)

View file

@ -6,22 +6,20 @@
#include "windowswitcher.h"
#include <KLocalizedString>
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);
}
}