summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/packagemanagercore.cpp
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2020-02-03 09:45:11 +0200
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2020-02-03 13:45:59 +0000
commit7daa9642fef7e77e1dd564ad22904032de0f89b3 (patch)
tree420cdbd9ee3632d969a4cd67d1c1f2fba9cfcb1b /src/libs/installer/packagemanagercore.cpp
parentc7524d53054d6051e335b552a54f8ee9d0b16ce0 (diff)
Enable command line default components installation
Add --installDefault option to install components that are set to be checked by default and their respective dependencies. Do not do anything if the component tree does not have anything checked by default. Task-number: QTIFW-1583 Change-Id: I3825c7e797b102a8d6a65ae0e57bfe82fafef5e9 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer/packagemanagercore.cpp')
-rw-r--r--src/libs/installer/packagemanagercore.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp
index 8e9131353..416e91541 100644
--- a/src/libs/installer/packagemanagercore.cpp
+++ b/src/libs/installer/packagemanagercore.cpp
@@ -2139,6 +2139,24 @@ void PackageManagerCore::installSelectedComponentsSilently(const QStringList& co
}
/*!
+ Installs components that are checked by default, i.e. those that are set
+ with <Default> or <ForcedInstallation> and their respective dependencies.
+*/
+void PackageManagerCore::installDefaultComponentsSilently()
+{
+ ComponentModel *model = defaultComponentModel();
+ fetchRemotePackagesTree();
+
+ if (!(model->checkedState() & ComponentModel::AllUnchecked)) {
+ // There are components that are checked by default, we should install them
+ if (d->calculateComponentsAndRun())
+ qCDebug(QInstaller::lcInstallerInstallLog) << "Components installed successfully.";
+ } else {
+ qCDebug(QInstaller::lcInstallerInstallLog) << "No components available for default installation.";
+ }
+}
+
+/*!
Returns the settings for the package manager.
*/
Settings &PackageManagerCore::settings() const