|
| PackageStructure (QObject *parent=nullptr, const QVariantList &args=QVariantList()) |
|
virtual void | initPackage (Package *package) |
| Called when a the PackageStructure should initialize a Package with the initial structure.
|
|
virtual KJob * | install (Package *package, const QString &archivePath, const QString &packageRoot) |
| Installs a package matching this package structure.
|
|
virtual void | pathChanged (Package *package) |
| Called whenever the path changes so that subclasses may take package specific actions.
|
|
virtual KJob * | uninstall (Package *package, const QString &packageRoot) |
| Uninstalls a package matching this package structure.
|
|
virtual KJob * | update (Package *package, const QString &archivePath, const QString &packageRoot) |
| Updates a package matching this package structure.
|
|
This class is used to define the filesystem structure of a package type.
A PackageStructure is implemented as a dynamically loaded plugin, in the reimplementation of initPackage the allowed fines and directories in the package are set into the package, for instance:
package->addFileDefinition("mainscript", QStringLiteral("ui/main.qml"), i18n("Main Script File"));
package->setDefaultPackageRoot(QStringLiteral("plasma/wallpapers/"));
package->addDirectoryDefinition("images", QStringLiteral("images"), i18n("Images"));
package->addDirectoryDefinition("theme", QStringLiteral("theme"), i18n("Themed Images"));
QStringList mimetypes;
mimetypes << QStringLiteral("image/svg+xml") << QStringLiteral("image/png") << QStringLiteral("image/jpeg");
package->setMimeTypes("images", mimetypes);
- Author
- Aaron Seigo