Fix unnecessary component calculate in silentUpdate

If there are no updates available, no need to calculate components to
install

Change-Id: I95068ef0e062f1745cbe10138407e658befb2c5b
Reviewed-by: Antti Kokko <antti.kokko@qt.io>
This commit is contained in:
Katja Marttila 2017-05-02 13:21:53 +03:00
parent 4ea0d10d72
commit 535a54337e

View File

@ -1805,17 +1805,21 @@ void PackageManagerCore::updateComponentsSilently()
const QList<QInstaller::Component*> componentList = components(
ComponentType::Root | ComponentType::Descendants);
foreach (Component *comp, componentList) {
comp->setCheckState(Qt::Checked);
}
QString htmlOutput;
bool componentsOk = calculateComponents(&htmlOutput);
if (componentsOk) {
if (runPackageUpdater())
qDebug() << "Components updated successfully.";
}
else {
qDebug() << htmlOutput;
if (componentList.count() == 0) {
qDebug() << "No updates available.";
} else {
foreach (Component *comp, componentList) {
comp->setCheckState(Qt::Checked);
}
QString htmlOutput;
bool componentsOk = calculateComponents(&htmlOutput);
if (componentsOk) {
if (runPackageUpdater())
qDebug() << "Components updated successfully.";
}
else {
qDebug() << htmlOutput;
}
}
}