diff options
author | Katja Marttila <katja.marttila@qt.io> | 2020-06-04 11:16:00 +0300 |
---|---|---|
committer | Katja Marttila <katja.marttila@qt.io> | 2020-06-04 13:38:56 +0300 |
commit | 25e70dd8e061425be89481caf515591390425cd5 (patch) | |
tree | b6ed06112e508a84234e856e59af2c47ae7b2bd0 | |
parent | bfa5f007a126f8899b174b9412e9a980b068510c (diff) |
Obey --show-virtual-components in cli search
Virtual components cannot be installed unless --show-virtual-components
is used. For the same reason, don't show the virtual components in search unless
--show-virtual-components is used as otherwise user might miss that he
is trying to install virtual component.
Task-number: QTIFW-1828
Change-Id: I5a0492f6894596ed2cfb7ce438bbf55e89799c31
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
-rw-r--r-- | src/libs/installer/packagemanagercore.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp index 885604135..bb9608505 100644 --- a/src/libs/installer/packagemanagercore.cpp +++ b/src/libs/installer/packagemanagercore.cpp @@ -2146,7 +2146,8 @@ void PackageManagerCore::listAvailablePackages(const QString ®exp) bool foundMatch = false; foreach (const Package *update, packages) { const QString name = update->data(scName).toString(); - if (re.match(name).hasMatch()) { + if (re.match(name).hasMatch() && + (virtualComponentsVisible() ? true : !update->data(scVirtual, false).toBool())) { printPackageInformation(name, update); foundMatch = true; } |