File indexing completed on 2024-07-21 03:42:17

0001 /*
0002     SPDX-FileCopyrightText: 2007-2009 Aaron Seigo <aseigo@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "packages_p.h"
0008 
0009 #include <math.h>
0010 
0011 #include <KLocalizedString>
0012 
0013 #include "kpackage/package.h"
0014 
0015 void GenericPackage::initPackage(KPackage::Package *package)
0016 {
0017     KPackage::PackageStructure::initPackage(package);
0018 
0019     package->setDefaultPackageRoot(QStringLiteral("kpackage/generic/"));
0020 
0021     package->addDirectoryDefinition("images", QStringLiteral("images"));
0022     package->addDirectoryDefinition("theme", QStringLiteral("theme"));
0023     const QStringList mimetypes{QStringLiteral("image/svg+xml"), QStringLiteral("image/png"), QStringLiteral("image/jpeg")};
0024     package->setMimeTypes("images", mimetypes);
0025     package->setMimeTypes("theme", mimetypes);
0026 
0027     package->addDirectoryDefinition("config", QStringLiteral("config"));
0028     package->setMimeTypes("config", QStringList{QStringLiteral("text/xml")});
0029 
0030     package->addDirectoryDefinition("ui", QStringLiteral("ui"));
0031 
0032     package->addDirectoryDefinition("data", QStringLiteral("data"));
0033 
0034     package->addDirectoryDefinition("scripts", QStringLiteral("code"));
0035     package->setMimeTypes("scripts", QStringList{QStringLiteral("text/plain")});
0036 
0037     package->addDirectoryDefinition("translations", QStringLiteral("locale"));
0038 }
0039 
0040 void GenericQMLPackage::initPackage(KPackage::Package *package)
0041 {
0042     GenericPackage::initPackage(package);
0043 
0044     package->addFileDefinition("mainscript", QStringLiteral("ui/main.qml"));
0045     package->setRequired("mainscript", true);
0046     package->setDefaultPackageRoot(QStringLiteral("kpackage/genericqml/"));
0047 }
0048 
0049 #include "moc_packages_p.cpp"