KPackage
kpackagetool.cpp
85 const QString hash = QString::fromLocal8Bit(package.cryptographicHash(QCryptographicHash::Sha1));
105 d->packageRoot = KPackage::PackageLoader::self()->loadPackage(d->kpackageType).defaultPackageRoot();
192 KPackage::PackageJob *uninstallJob = KPackage::PackageJob::uninstall(d->kpackageType, pluginName, d->packageRoot);
203 auto installJob = KPackage::PackageJob::install(d->kpackageType, d->packageFile, d->packageRoot);
211 "No option was given, this is the error message telling the user he needs at least one, do not translate install, remove, upgrade nor list",
233 const QList<KPluginMetaData> dataList = KPackage::PackageLoader::self()->listPackages(type, path);
312 // if the path passed is an absolute path, and a metadata file is found under it, use that metadata file to generate the appstream info.
313 // This can happen in the case an application wanting to support kpackage based extensions includes in the same project both the packagestructure plugin and
314 // the packages themselves. In that case at build time the packagestructure plugin wouldn't be installed yet
365 *cerr << "Error: description missing, will result in broken appdata field as <summary/> is mandatory at " << QFileInfo(i.fileName()).absoluteFilePath();
381 translateKPluginToAppstream(QStringLiteral("name"), QStringLiteral("Name"), rootObject, writer, false);
382 translateKPluginToAppstream(QStringLiteral("summary"), QStringLiteral("Description"), rootObject, writer, false);
393 writer.writeCharacters(QStringLiteral("https://www.kde.org/donate.php?app=%1").arg(i.pluginId()));
416 writer.writeTextElement(QStringLiteral("project_license"), KAboutLicense::byKeyword(i.license()).spdx());
428 qWarning() << i18nc("The user entered conflicting options packageroot and global, this is the error message telling the user he can use only one",
435 auto const paths = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, d->packageRoot, QStandardPaths::LocateDirectory);
440 packageRoot = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + d->packageRoot;
474 std::cout << nameHeader.toLocal8Bit().constData() << std::setw(nameWidth - nameHeader.length() + 2) << ' ' << pathHeader.toLocal8Bit().constData()
476 std::cout << std::setfill('-') << std::setw(nameWidth) << '-' << " " << std::setw(pathWidth) << '-' << " " << std::endl;
482 std::cout << pluginIt.key().toLocal8Bit().constData() << std::setw(nameWidth - pluginIt.key().length() + 2) << ' '
483 << pluginIt.value().toLocal8Bit().constData() << std::setw(pathWidth - pluginIt.value().length() + 2) << std::endl;
493 builtIns.insert(i18n("KPackage/Generic"), QStringLiteral(KPACKAGE_RELATIVE_DATA_INSTALL_DIR "/packages/"));
494 builtIns.insert(i18n("KPackage/GenericQML"), QStringLiteral(KPACKAGE_RELATIVE_DATA_INSTALL_DIR "/genericqml/"));
498 const QList<KPluginMetaData> offers = KPluginMetaData::findPlugins(QStringLiteral("kf6/packagestructure"));
542 auto installJob = KPackage::PackageJob::install(d->kpackageType, d->packageFile, d->packageRoot);
static KAboutLicense byKeyword(const QString &keyword)
QString spdx() const
int error() const
void finished(KJob *job)
QString errorText() const
KJob subclass that allows async install/update/uninstall operations for packages.
Definition packagejob.h:27
static PackageJob * uninstall(const QString &packageFormat, const QString &pluginId, const QString &packageRoot=QString())
Installs the given package. The returned job is already started.
Definition packagejob.cpp:136
static PackageJob * install(const QString &packageFormat, const QString &sourcePackage, const QString &packageRoot=QString())
Installs the given package. The returned job is already started.
Definition packagejob.cpp:94
Package loadPackage(const QString &packageFormat, const QString &packagePath=QString())
Load a Package plugin.
Definition packageloader.cpp:51
QList< KPluginMetaData > listPackages(const QString &packageFormat, const QString &packageRoot=QString())
List all available packages of a certain type.
Definition packageloader.cpp:132
This class is used to define the filesystem structure of a package type.
Definition packagestructure.h:38
void setPath(const QString &path)
Sets the path to the root of this package.
Definition package.cpp:439
void setDefaultPackageRoot(const QString &packageRoot)
Sets preferred package root.
Definition package.cpp:133
QString pluginId() const
QString website() const
bool value(QStringView key, bool defaultValue) const
QString license() const
QList< KAboutPerson > authors() const
QJsonObject rawData() const
QString fileName() const
static QList< KPluginMetaData > findPlugins(const QString &directory, std::function< bool(const KPluginMetaData &)> filter={}, KPluginMetaDataOptions options={})
QString iconName() const
QString name() const
bool isValid() const
static KPluginMetaData fromJsonFile(const QString &jsonFile)
QString description() const
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
Type type(const QSqlDatabase &db)
KCOREADDONS_EXPORT Result match(QStringView pattern, QStringView str)
QString path(const QString &relativePath)
KIOCORE_EXPORT QStringList list(const QString &fileClass)
const char * constData() const const
QString absolutePath() const const
QString currentPath()
bool isAbsolutePath(const QString &path)
bool exists() const const
QString absoluteFilePath() const const
QString canonicalFilePath() const const
WriteOnly
iterator begin()
iterator end()
QJsonValue value(QLatin1StringView key) const const
bool isUndefined() const const
QString toString() const const
bool isEmpty() const const
void reserve(qsizetype size)
iterator insert(const Key &key, const T &value)
LocateDirectory
GenericDataLocation
QStringList locateAll(StandardLocation type, const QString &fileName, LocateOptions options)
QString writableLocation(StandardLocation type)
QString & append(QChar ch)
void chop(qsizetype n)
bool endsWith(QChar c, Qt::CaseSensitivity cs) const const
QString fromLocal8Bit(QByteArrayView str)
bool isEmpty() const const
QString last(qsizetype n) const const
qsizetype length() const const
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
QByteArray toLocal8Bit() const const
bool contains(QLatin1StringView str, Qt::CaseSensitivity cs) const const
QString join(QChar separator) const const
void sort(Qt::CaseSensitivity cs)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
singleShot
QUrl fromUserInput(const QString &userInput, const QString &workingDirectory, UserInputResolutionOptions options)
void setAutoFormatting(bool enable)
void writeAttribute(QAnyStringView namespaceUri, QAnyStringView name, QAnyStringView value)
void writeAttributes(const QXmlStreamAttributes &attributes)
void writeCharacters(QAnyStringView text)
void writeEndDocument()
void writeEndElement()
void writeStartDocument()
void writeStartElement(QAnyStringView namespaceUri, QAnyStringView name)
void writeTextElement(QAnyStringView namespaceUri, QAnyStringView name, QAnyStringView text)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:13:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:13:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.