File indexing completed on 2024-11-10 04:57:01

0001 /*
0002     SPDX-FileCopyrightText: 2018 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include <KPackage/PackageStructure>
0008 
0009 class EffectPackageStructure : public KPackage::PackageStructure
0010 {
0011     Q_OBJECT
0012 public:
0013     using KPackage::PackageStructure::PackageStructure;
0014     void initPackage(KPackage::Package *package) override
0015     {
0016         package->setDefaultPackageRoot(QStringLiteral("kwin/effects/"));
0017 
0018         package->addDirectoryDefinition("code", QStringLiteral("code"));
0019         package->setMimeTypes("code", QStringList{QStringLiteral("text/plain")});
0020 
0021         package->addFileDefinition("mainscript", QStringLiteral("code/main.js"));
0022         package->setRequired("mainscript", true);
0023 
0024         package->addFileDefinition("config", QStringLiteral("config/main.xml"));
0025         package->setMimeTypes("config", QStringList{QStringLiteral("text/xml")});
0026 
0027         package->addFileDefinition("configui", QStringLiteral("ui/config.ui"));
0028         package->setMimeTypes("configui", QStringList{QStringLiteral("text/xml")});
0029     }
0030 };
0031 
0032 K_PLUGIN_CLASS_WITH_JSON(EffectPackageStructure, "effect.json")
0033 
0034 #include "effect.moc"