KPackage::PackageJob Class

KJob subclass that allows async install/update/uninstall operations for packages. More...

Header: #include <KPackage/PackageJob>
CMake: find_package(KF6 REQUIRED COMPONENTS Package)
target_link_libraries(mytarget PRIVATE KF6::Package)

Public Types

enum JobError { InvalidPackageStructure, RootCreationError, PackageFileNotFoundError, UnsupportedArchiveFormatError, PackageOpenError, …, PackageUninstallError }

Public Functions

KPackage::Package package() const

Static Public Members

KPackage::PackageJob *install(const QString &packageFormat, const QString &sourcePackage, const QString &packageRoot = QString())
KPackage::PackageJob *uninstall(const QString &packageFormat, const QString &pluginId, const QString &packageRoot = QString())
KPackage::PackageJob *update(const QString &packageFormat, const QString &sourcePackage, const QString &packageRoot = QString())

Detailed Description

Member Type Documentation

enum PackageJob::JobError

Error codes for the install/update/remove jobs

ConstantValueDescription
KPackage::PackageJob::InvalidPackageStructureKJob::UserDefinedError + 1Could not find/load the given package structure
KPackage::PackageJob::RootCreationError102Cannot create package root directory
KPackage::PackageJob::PackageFileNotFoundError103The package file does not exist
KPackage::PackageJob::UnsupportedArchiveFormatError104The archive format of the package is not supported
KPackage::PackageJob::PackageOpenError105Can't open the package file for reading
KPackage::PackageJob::PluginIdInvalidError106The plugin id is not specified in the metadata.json file or contains characters different from letters, digits, dots and underscores
KPackage::PackageJob::UpdatePackageTypeMismatchError107A package with this plugin id was already installed, but has a different type in the metadata.json file
KPackage::PackageJob::OldVersionRemovalError108Failed to remove the old version of the package during an upgrade
KPackage::PackageJob::NewerVersionAlreadyInstalledError109We tried to update, but the same version or a newer one is already installed
KPackage::PackageJob::PackageAlreadyInstalledError110The package is already installed and a normal install (not update) was performed
KPackage::PackageJob::PackageMoveError111Failure to move a package from the system temporary folder to its final destination
KPackage::PackageJob::PackageCopyError112Failure to copy a package folder from somewhere in the filesystem to its final destination
KPackage::PackageJob::PackageUninstallError113Failure to uninstall a package

Member Function Documentation

[static] KPackage::PackageJob *PackageJob::install(const QString &packageFormat, const QString &sourcePackage, const QString &packageRoot = QString())

Installs the given package. The returned job is already started

KPackage::Package PackageJob::package() const

[static] KPackage::PackageJob *PackageJob::uninstall(const QString &packageFormat, const QString &pluginId, const QString &packageRoot = QString())

Installs the given package. The returned job is already started

[static] KPackage::PackageJob *PackageJob::update(const QString &packageFormat, const QString &sourcePackage, const QString &packageRoot = QString())

Installs the given package. The returned job is already started