diff options
-rw-r--r-- | src/libs/installer/packagemanagercore.cpp | 3 | ||||
-rw-r--r-- | tests/auto/installer/cliinterface/tst_cliinterface.cpp | 12 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/libs/installer/packagemanagercore.cpp b/src/libs/installer/packagemanagercore.cpp index 59a0d05dd..a67ecbf8e 100644 --- a/src/libs/installer/packagemanagercore.cpp +++ b/src/libs/installer/packagemanagercore.cpp @@ -2411,7 +2411,8 @@ bool PackageManagerCore::installSelectedComponentsSilently(const QStringList& co const QModelIndex &idx = model->indexFromComponentName(name); Component *component = componentByName(name); if (idx.isValid()) { - if (model->data(idx, Qt::CheckStateRole) == QVariant::Invalid) { // User cannot select the component, check why + if ((model->data(idx, Qt::CheckStateRole) == QVariant::Invalid) && + !component->forcedInstallation()) { // User cannot select the component, check why if (component && component->autoDependencies().count() > 0) qCDebug(QInstaller::lcInstallerInstallLog).noquote().nospace() << "Cannot install component "<< name << ". Component is installed only as automatic dependency to "<< component->autoDependencies().join(QLatin1Char(',')) << "."; diff --git a/tests/auto/installer/cliinterface/tst_cliinterface.cpp b/tests/auto/installer/cliinterface/tst_cliinterface.cpp index a9e58a656..364d9ae9d 100644 --- a/tests/auto/installer/cliinterface/tst_cliinterface.cpp +++ b/tests/auto/installer/cliinterface/tst_cliinterface.cpp @@ -159,6 +159,18 @@ private slots: QVERIFY(dir.removeRecursively()); } + void testInstallForcedPackageSilently() + { + PackageManagerCore *core = PackageManager::getPackageManagerWithInit + (m_installDir, ":///data/installPackagesRepository"); + core->installSelectedComponentsSilently(QStringList() << QLatin1String("componentE")); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentA", "1.0.0content.txt"); + VerifyInstaller::verifyInstallerResources(m_installDir, "componentE", "1.0.0content.txt"); //ForcedInstall + VerifyInstaller::verifyInstallerResources(m_installDir, "componentG", "1.0.0content.txt"); //Depends on componentA + VerifyInstaller::verifyFileExistence(m_installDir, QStringList() << "components.xml" << "installcontent.txt" + << "installcontentA.txt" << "installcontentE.txt" << "installcontentG.txt"); + } + void testInstallPackageSilently() { PackageManagerCore *core = PackageManager::getPackageManagerWithInit |