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->addFileDefinition("close", QStringLiteral("close.svgz"));
package->addFileDefinition("minimize", QStringLiteral("minimize.svgz"));
package->addFileDefinition("maximize", QStringLiteral("maximize.svgz"));
package->addFileDefinition("restore", QStringLiteral("restore.svgz"));
package->addFileDefinition("alldesktops", QStringLiteral("alldesktops.svgz"));
package->addFileDefinition("keepabove", QStringLiteral("keepabove.svgz"));
package->addFileDefinition("keepbelow", QStringLiteral("keepbelow.svgz"));
package->addFileDefinition("shade", QStringLiteral("shade.svgz"));
package->addFileDefinition("help", QStringLiteral("help.svgz"));
package->addFileDefinition("configrc", QStringLiteral("configrc"));
QStringList mimetypes;
mimetypes << QStringLiteral("image/svg+xml-compressed");
package->setDefaultMimeTypes(mimetypes);
package->setDefaultMimeTypes(QStringList{QStringLiteral("image/svg+xml-compressed")});
}
void AuroraePackage::pathChanged(KPackage::Package *package)

View file

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

View file

@ -16,16 +16,16 @@ void EffectPackageStructure::initPackage(KPackage::Package *package)
package->setDefaultPackageRoot(QStringLiteral("kwin/effects/"));
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->setRequired("mainscript", true);
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->setMimeTypes("configui", {QStringLiteral("text/xml")});
package->setMimeTypes("configui", QStringList{QStringLiteral("text/xml")});
}
void EffectPackageStructure::pathChanged(KPackage::Package *package)

View file

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

View file

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