summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/packagemanagercore.cpp
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2020-11-16 11:45:41 +0200
committerKatja Marttila <katja.marttila@qt.io>2020-11-25 12:02:39 +0200
commitf053b9a627921b03529b4f797a97b582675fbe71 (patch)
tree1b7d42edbf7c22bfdf3eca3938fd27eee3414be5 /src/libs/installer/packagemanagercore.cpp
parent79011733f7a00da988d482dde443418c9df38784 (diff)
Print package information in xml format
Also removed logging categories for package information, the full package information can be printed by increasing the verbosity level. Task-number: QTIFW-1950 Change-Id: I4bce019a63ba1fbf48e3bb0ca45511e42d4974c9 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
Diffstat (limited to 'src/libs/installer/packagemanagercore.cpp')
-rw-r--r--src/libs/installer/packagemanagercore.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index a921884b2..e4b0e1689 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -45,6 +45,7 @@
#include "settings.h"
#include "installercalculator.h"
#include "uninstallercalculator.h"
+#include "printoutput.h"
#include <productkeycheck.h>
@@ -2195,17 +2196,18 @@ void PackageManagerCore::listAvailablePackages(const QString &regexp)
QRegularExpression re(regexp);
const PackagesList &packages = d->remotePackages();
- bool foundMatch = false;
- foreach (const Package *update, packages) {
- const QString name = update->data(scName).toString();
+ PackagesList matchedPackages;
+ foreach (Package *package, packages) {
+ const QString name = package->data(scName).toString();
if (re.match(name).hasMatch() &&
- (virtualComponentsVisible() ? true : !update->data(scVirtual, false).toBool())) {
- d->printPackageInformation(name, update);
- foundMatch = true;
+ (virtualComponentsVisible() ? true : !package->data(scVirtual, false).toBool())) {
+ matchedPackages.append(package);
}
}
- if (!foundMatch)
+ if (matchedPackages.count() == 0)
qCDebug(QInstaller::lcInstallerInstallLog) << "No matching packages found.";
+ else
+ QInstaller::printPackageInformation(matchedPackages, localInstalledPackages());
}
bool PackageManagerCore::componentUninstallableFromCommandLine(const QString &componentName)
@@ -2254,11 +2256,13 @@ void PackageManagerCore::listInstalledPackages(const QString &regexp)
const QRegularExpression re(regexp);
const QStringList &keys = installedPackages.keys();
+ QList<LocalPackage> packages;
foreach (const QString &key, keys) {
KDUpdater::LocalPackage package = installedPackages.value(key);
if (re.match(package.name).hasMatch())
- d->printLocalPackageInformation(package);
+ packages.append(package);
}
+ QInstaller::printLocalPackageInformation(packages);
}
/*!