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
Constant | Value | Description |
---|---|---|
KPackage::PackageJob::InvalidPackageStructure | KJob::UserDefinedError + 1 | Could not find/load the given package structure |
KPackage::PackageJob::RootCreationError | 102 | Cannot create package root directory |
KPackage::PackageJob::PackageFileNotFoundError | 103 | The package file does not exist |
KPackage::PackageJob::UnsupportedArchiveFormatError | 104 | The archive format of the package is not supported |
KPackage::PackageJob::PackageOpenError | 105 | Can't open the package file for reading |
KPackage::PackageJob::PluginIdInvalidError | 106 | The plugin id is not specified in the metadata.json file or contains characters different from letters, digits, dots and underscores |
KPackage::PackageJob::UpdatePackageTypeMismatchError | 107 | A package with this plugin id was already installed, but has a different type in the metadata.json file |
KPackage::PackageJob::OldVersionRemovalError | 108 | Failed to remove the old version of the package during an upgrade |
KPackage::PackageJob::NewerVersionAlreadyInstalledError | 109 | We tried to update, but the same version or a newer one is already installed |
KPackage::PackageJob::PackageAlreadyInstalledError | 110 | The package is already installed and a normal install (not update) was performed |
KPackage::PackageJob::PackageMoveError | 111 | Failure to move a package from the system temporary folder to its final destination |
KPackage::PackageJob::PackageCopyError | 112 | Failure to copy a package folder from somewhere in the filesystem to its final destination |
KPackage::PackageJob::PackageUninstallError | 113 | Failure 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