Changeset View
Changeset View
Standalone View
Standalone View
src/kpackagetool/kpackagetool.cpp
Show First 20 Lines • Show All 431 Lines • ▼ Show 20 Line(s) | |||||
432 | 432 | | |||
433 | void PackageTool::showAppstreamInfo(const QString &pluginName) | 433 | void PackageTool::showAppstreamInfo(const QString &pluginName) | ||
434 | { | 434 | { | ||
435 | KPluginMetaData i; | 435 | KPluginMetaData i; | ||
436 | //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. | 436 | //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. | ||
437 | // This can happen in the case an application wanting to support kpackage based extensions includes in the same project both the packagestructure plugin and the packages themselves. In that case at build time the packagestructure plugin wouldn't be installed yet | 437 | // This can happen in the case an application wanting to support kpackage based extensions includes in the same project both the packagestructure plugin and the packages themselves. In that case at build time the packagestructure plugin wouldn't be installed yet | ||
438 | 438 | | |||
439 | if (QFile::exists(pluginName + QStringLiteral("/metadata.desktop"))) { | 439 | if (QFile::exists(pluginName + QStringLiteral("/metadata.desktop"))) { | ||
440 | i = KPluginMetaData(pluginName + QStringLiteral("/metadata.desktop")); | 440 | i = KPluginMetaData::fromDesktopFile(pluginName + QStringLiteral("/metadata.desktop"), {QStringLiteral(":/kservicetypes5/kpackage-generic.desktop")}); | ||
441 | } else if (QFile::exists(pluginName + QStringLiteral("/metadata.json"))) { | 441 | } else if (QFile::exists(pluginName + QStringLiteral("/metadata.json"))) { | ||
442 | i = KPluginMetaData(pluginName + QStringLiteral("/metadata.json")); | 442 | i = KPluginMetaData(pluginName + QStringLiteral("/metadata.json")); | ||
443 | } else { | 443 | } else { | ||
444 | QString type = QStringLiteral("KPackage/Generic"); | 444 | QString type = QStringLiteral("KPackage/Generic"); | ||
445 | if (!d->pluginTypes.contains(type) && !d->pluginTypes.isEmpty()) { | 445 | if (!d->pluginTypes.contains(type) && !d->pluginTypes.isEmpty()) { | ||
446 | type = d->pluginTypes.at(0); | 446 | type = d->pluginTypes.at(0); | ||
447 | } | 447 | } | ||
448 | KPackage::Package pkg = KPackage::PackageLoader::self()->loadPackage(type); | 448 | KPackage::Package pkg = KPackage::PackageLoader::self()->loadPackage(type); | ||
▲ Show 20 Lines • Show All 359 Lines • Show Last 20 Lines |