Plasma
packagestructure.cpp
Go to the documentation of this file.
222 QList<const char*> dirs;
250 QMap<QByteArray, ContentStructure>::const_iterator it = d->contents.constBegin();
294 QStringList PackageStructurePrivate::entryList(const QString &prefix, const QString &requestedPath)
329 }
331 void PackageStructure::addFileDefinition(const char *key, const QString &path, const QString &name)
383 }
395 it.value().required = required;
415 QMap<QByteArray, ContentStructure>::iterator it = d->contents.find(key);
425 QMap<QByteArray, ContentStructure>::const_iterator it = d->contents.constFind(key);
440 QDir dir(url.toLocalFile());
487 KConfigGroup entry(config, group);
551 {
556 QMutableStringListIterator it(d->contentsPrefixPaths);
562 }
567 {
583 {
588 {
593 {
614 }
630 } else if (mimetype->is("application/x-compressed-tar") || mimetype->is("application/x-gzip") ||
631 mimetype->is("application/x-xz-compressed-tar") || mimetype->is("application/x-lzma-compressed-tar") ||
635 kWarning() << "Could not open package file, unsupported archive format:" << d->path << mimetype->name();
643 // This is to help with the theme packages, which include an extra folder in their package archive.
void setMimetypes(const char *key, QStringList mimetypes)
Define mimetypes for a given part of the structure The path must already have been added using addDir...
Definition: packagestructure.cpp:430
void read(const KConfigBase *config)
Read a package structure from a config file.
Definition: packagestructure.cpp:492
QList< const char * > files() const
The individual files, by key, that are defined for this package.
Definition: packagestructure.cpp:264
void setDefaultMimetypes(QStringList mimetypes)
Defines the default mimetypes for any definitions that do not have associated mimetypes.
Definition: packagestructure.cpp:425
QStringList searchPath(const char *key) const
Definition: packagestructure.cpp:383
QStringList entryList(const char *key)
Get the list of files of a given type.
Definition: packagestructure.cpp:290
PackageStructure::Ptr defaultPackageStructure(ComponentType type)
Definition: scriptengine.cpp:254
QList< const char * > directories() const
The directories defined for this package.
Definition: packagestructure.cpp:237
void setServicePrefix(const QString &servicePrefix)
Sets service prefix.
Definition: packagestructure.cpp:614
void addFileDefinition(const char *key, const QString &path, const QString &name)
Adds a file to the structure of the package.
Definition: packagestructure.cpp:348
QString servicePrefix() const
Definition: packagestructure.cpp:604
PackageStructure(QObject *parent=0, const QString &type=i18nc("A non-functional package", "Invalid"))
Default constructor for a package structure definition.
Definition: packagestructure.cpp:125
static bool installPackage(const QString &package, const QString &packageRoot, const QString &servicePrefix)
Installs a package.
Definition: package.cpp:482
bool allowExternalPaths() const
Definition: packagestructure.cpp:697
void setDefaultPackageRoot(const QString &packageRoot)
Sets preferred package root.
Definition: packagestructure.cpp:609
void newWidgetBrowserFinished()
Emitted when the new widget browser process completes.
PackageStructure & operator=(const PackageStructure &rhs)
Assignment operator.
Definition: packagestructure.cpp:222
virtual void createNewWidgetBrowser(QWidget *parent=0)
When called, the package plugin should display a window to the user that they can use to browser,...
Definition: packagestructure.cpp:593
bool isRequired(const char *key) const
Definition: packagestructure.cpp:415
void setRequired(const char *key, bool required)
Sets whether or not a given part of the structure is required or not.
Definition: packagestructure.cpp:405
virtual bool uninstallPackage(const QString &packageName, const QString &packageRoot)
Uninstalls a package matching this package structure.
Definition: packagestructure.cpp:588
QString defaultPackageRoot() const
Definition: packagestructure.cpp:599
void setContentsPrefix(const QString &prefix)
Sets the prefix that all the contents in this package should appear under.
Definition: packagestructure.cpp:556
A description of the expected file structure of a given package type.
Definition: packagestructure.h:72
static bool uninstallPackage(const QString &package, const QString &packageRoot, const QString &servicePrefix)
Uninstalls a package.
Definition: package.cpp:646
QList< const char * > requiredDirectories() const
The required directories defined for this package.
Definition: packagestructure.cpp:250
static PackageStructure::Ptr packageStructure()
Definition: theme.cpp:590
void addDirectoryDefinition(const char *key, const QString &path, const QString &name)
Adds a directory to the structure of the package.
Definition: packagestructure.cpp:329
static QScriptValue type(QScriptContext *ctx, QScriptEngine *eng)
Definition: easingcurve.cpp:63
void setContentsPrefixPaths(const QStringList &prefixPaths)
Sets the prefixes that all the contents in this package should appear under.
Definition: packagestructure.cpp:567
QList< const char * > requiredFiles() const
The individual required files, by key, that are defined for this package.
Definition: packagestructure.cpp:277
QStringList mimetypes(const char *key) const
Definition: packagestructure.cpp:440
virtual bool installPackage(const QString &archivePath, const QString &packageRoot)
Installs a package matching this package structure.
Definition: packagestructure.cpp:583
virtual PackageMetadata metadata()
Definition: packagestructure.cpp:634
void setAllowExternalPaths(bool allow)
Sets whether or not external paths/symlinks can be followed by a package.
Definition: packagestructure.cpp:702
QString name(const char *key) const
Definition: packagestructure.cpp:395
virtual void pathChanged()
Called whenever the path changes so that subclasses may take package specific actions.
Definition: packagestructure.cpp:487
void write(KConfigBase *config) const
Write this package structure to a config file.
Definition: packagestructure.cpp:524
QString contentsPrefix() const
Definition: packagestructure.cpp:551
static PackageStructure::Ptr load(const QString &packageFormat)
Loads a package format by name.
Definition: packagestructure.cpp:136
QStringList contentsPrefixPaths() const
Definition: packagestructure.cpp:562
void removeDefinition(const char *key)
Removes a definition from the structure of the package.
Definition: packagestructure.cpp:366
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Jan 19 2020 00:00:00 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Jan 19 2020 00:00:00 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.