plugins/kpackage: Modernize code using initializer list syntax

This commit is contained in:
Alexander Lohnau 2023-04-02 07:42:00 +02:00
parent 7e76525f6e
commit 017da14444
5 changed files with 10 additions and 34 deletions

View file

@ -15,28 +15,16 @@ void AuroraePackage::initPackage(KPackage::Package *package)
package->setRequired("decoration", true); package->setRequired("decoration", true);
package->addFileDefinition("close", QStringLiteral("close.svgz")); package->addFileDefinition("close", QStringLiteral("close.svgz"));
package->addFileDefinition("minimize", QStringLiteral("minimize.svgz")); package->addFileDefinition("minimize", QStringLiteral("minimize.svgz"));
package->addFileDefinition("maximize", QStringLiteral("maximize.svgz")); package->addFileDefinition("maximize", QStringLiteral("maximize.svgz"));
package->addFileDefinition("restore", QStringLiteral("restore.svgz")); package->addFileDefinition("restore", QStringLiteral("restore.svgz"));
package->addFileDefinition("alldesktops", QStringLiteral("alldesktops.svgz")); package->addFileDefinition("alldesktops", QStringLiteral("alldesktops.svgz"));
package->addFileDefinition("keepabove", QStringLiteral("keepabove.svgz")); package->addFileDefinition("keepabove", QStringLiteral("keepabove.svgz"));
package->addFileDefinition("keepbelow", QStringLiteral("keepbelow.svgz")); package->addFileDefinition("keepbelow", QStringLiteral("keepbelow.svgz"));
package->addFileDefinition("shade", QStringLiteral("shade.svgz")); package->addFileDefinition("shade", QStringLiteral("shade.svgz"));
package->addFileDefinition("help", QStringLiteral("help.svgz")); package->addFileDefinition("help", QStringLiteral("help.svgz"));
package->addFileDefinition("configrc", QStringLiteral("configrc")); package->addFileDefinition("configrc", QStringLiteral("configrc"));
package->setDefaultMimeTypes(QStringList{QStringLiteral("image/svg+xml-compressed")});
QStringList mimetypes;
mimetypes << QStringLiteral("image/svg+xml-compressed");
package->setDefaultMimeTypes(mimetypes);
} }
void AuroraePackage::pathChanged(KPackage::Package *package) void AuroraePackage::pathChanged(KPackage::Package *package)

View file

@ -11,9 +11,7 @@ void DecorationPackage::initPackage(KPackage::Package *package)
package->setDefaultPackageRoot(QStringLiteral("kwin/decorations/")); package->setDefaultPackageRoot(QStringLiteral("kwin/decorations/"));
package->addDirectoryDefinition("config", QStringLiteral("config")); package->addDirectoryDefinition("config", QStringLiteral("config"));
QStringList mimetypes; package->setMimeTypes("config", QStringList{QStringLiteral("text/xml")});
mimetypes << QStringLiteral("text/xml");
package->setMimeTypes("config", mimetypes);
package->addDirectoryDefinition("ui", QStringLiteral("ui")); package->addDirectoryDefinition("ui", QStringLiteral("ui"));
@ -22,9 +20,7 @@ void DecorationPackage::initPackage(KPackage::Package *package)
package->addFileDefinition("mainscript", QStringLiteral("code/main.qml")); package->addFileDefinition("mainscript", QStringLiteral("code/main.qml"));
package->setRequired("mainscript", true); package->setRequired("mainscript", true);
mimetypes.clear(); package->setMimeTypes("decoration", QStringList{QStringLiteral("text/plain")});
mimetypes << QStringLiteral("text/plain");
package->setMimeTypes("decoration", mimetypes);
} }
void DecorationPackage::pathChanged(KPackage::Package *package) void DecorationPackage::pathChanged(KPackage::Package *package)

View file

@ -16,16 +16,16 @@ void EffectPackageStructure::initPackage(KPackage::Package *package)
package->setDefaultPackageRoot(QStringLiteral("kwin/effects/")); package->setDefaultPackageRoot(QStringLiteral("kwin/effects/"));
package->addDirectoryDefinition("code", QStringLiteral("code")); package->addDirectoryDefinition("code", QStringLiteral("code"));
package->setMimeTypes("code", {QStringLiteral("text/plain")}); package->setMimeTypes("code", QStringList{QStringLiteral("text/plain")});
package->addFileDefinition("mainscript", QStringLiteral("code/main.js")); package->addFileDefinition("mainscript", QStringLiteral("code/main.js"));
package->setRequired("mainscript", true); package->setRequired("mainscript", true);
package->addFileDefinition("config", QStringLiteral("config/main.xml")); package->addFileDefinition("config", QStringLiteral("config/main.xml"));
package->setMimeTypes("config", {QStringLiteral("text/xml")}); package->setMimeTypes("config", QStringList{QStringLiteral("text/xml")});
package->addFileDefinition("configui", QStringLiteral("ui/config.ui")); package->addFileDefinition("configui", QStringLiteral("ui/config.ui"));
package->setMimeTypes("configui", {QStringLiteral("text/xml")}); package->setMimeTypes("configui", QStringList{QStringLiteral("text/xml")});
} }
void EffectPackageStructure::pathChanged(KPackage::Package *package) void EffectPackageStructure::pathChanged(KPackage::Package *package)

View file

@ -11,9 +11,7 @@ void ScriptsPackage::initPackage(KPackage::Package *package)
package->setDefaultPackageRoot(QStringLiteral("kwin/scripts/")); package->setDefaultPackageRoot(QStringLiteral("kwin/scripts/"));
package->addDirectoryDefinition("config", QStringLiteral("config")); package->addDirectoryDefinition("config", QStringLiteral("config"));
QStringList mimetypes; package->setMimeTypes("config", QStringList{QStringLiteral("text/xml")});
mimetypes << QStringLiteral("text/xml");
package->setMimeTypes("config", mimetypes);
package->addDirectoryDefinition("ui", QStringLiteral("ui")); package->addDirectoryDefinition("ui", QStringLiteral("ui"));
@ -22,9 +20,7 @@ void ScriptsPackage::initPackage(KPackage::Package *package)
package->addFileDefinition("mainscript", QStringLiteral("code/main.js")); package->addFileDefinition("mainscript", QStringLiteral("code/main.js"));
package->setRequired("mainscript", true); package->setRequired("mainscript", true);
mimetypes.clear(); package->setMimeTypes("scripts", QStringList{QStringLiteral("text/plain")});
mimetypes << QStringLiteral("text/plain");
package->setMimeTypes("scripts", mimetypes);
} }
void ScriptsPackage::pathChanged(KPackage::Package *package) void ScriptsPackage::pathChanged(KPackage::Package *package)

View file

@ -11,9 +11,7 @@ void SwitcherPackage::initPackage(KPackage::Package *package)
package->setDefaultPackageRoot(QStringLiteral("kwin/tabbox/")); package->setDefaultPackageRoot(QStringLiteral("kwin/tabbox/"));
package->addDirectoryDefinition("config", QStringLiteral("config")); package->addDirectoryDefinition("config", QStringLiteral("config"));
QStringList mimetypes; package->setMimeTypes("config", QStringList{QStringLiteral("text/xml")});
mimetypes << QStringLiteral("text/xml");
package->setMimeTypes("config", mimetypes);
package->addDirectoryDefinition("ui", QStringLiteral("ui")); package->addDirectoryDefinition("ui", QStringLiteral("ui"));
@ -22,9 +20,7 @@ void SwitcherPackage::initPackage(KPackage::Package *package)
package->addFileDefinition("mainscript", QStringLiteral("ui/main.qml")); package->addFileDefinition("mainscript", QStringLiteral("ui/main.qml"));
package->setRequired("mainscript", true); package->setRequired("mainscript", true);
mimetypes.clear(); package->setMimeTypes("windowswitcher", QStringList(QStringLiteral("text/plain")));
mimetypes << QStringLiteral("text/plain");
package->setMimeTypes("windowswitcher", mimetypes);
} }
void SwitcherPackage::pathChanged(KPackage::Package *package) void SwitcherPackage::pathChanged(KPackage::Package *package)