From a28cf55b5a5007c0dd952b3012c076d9da329f0f Mon Sep 17 00:00:00 2001 From: Katja Marttila Date: Fri, 25 Mar 2022 15:38:50 +0200 Subject: Speed up component selection in component selection pages If a lot of components are installed, maintenancetool was slow to select/unselect a single component. This was caused because the whole tree's components were recalculated. Fixed so that only the selected/unselected components and their dependencies and autodependencies are recalculated instead of whole tree. This change speeds up clicking tree item from zero to 90 percent, depending on how much components are already installed. The more components are installed as autodependency, the slower it gets to select the items. Task-number: QTIFW-2522 Change-Id: I5e824aed8787fd7ecdce72b15a1b13848f0a3923 Reviewed-by: Arttu Tarkiainen --- src/libs/installer/componentselectionpage_p.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/libs/installer/componentselectionpage_p.cpp') diff --git a/src/libs/installer/componentselectionpage_p.cpp b/src/libs/installer/componentselectionpage_p.cpp index e775c0cb4..5e44d153c 100644 --- a/src/libs/installer/componentselectionpage_p.cpp +++ b/src/libs/installer/componentselectionpage_p.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2021 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -185,10 +185,16 @@ ComponentSelectionPagePrivate::ComponentSelectionPagePrivate(ComponentSelectionP m_stackedLayout->addWidget(progressStackedWidget); m_stackedLayout->setCurrentIndex(0); - connect(m_allModel, SIGNAL(checkStateChanged(QInstaller::ComponentModel::ModelState)), this, - SLOT(onModelStateChanged(QInstaller::ComponentModel::ModelState))); - connect(m_updaterModel, SIGNAL(checkStateChanged(QInstaller::ComponentModel::ModelState)), - this, SLOT(onModelStateChanged(QInstaller::ComponentModel::ModelState))); + connect(m_allModel, &ComponentModel::modelCheckStateChanged, + this, &ComponentSelectionPagePrivate::onModelStateChanged); + connect(m_updaterModel, &ComponentModel::modelCheckStateChanged, + this, &ComponentSelectionPagePrivate::onModelStateChanged); + + connect(m_allModel, &ComponentModel::componentsCheckStateChanged, this, + [=]() { onModelStateChanged(m_allModel->checkedState());}); + + connect(m_updaterModel, &ComponentModel::componentsCheckStateChanged, this, + [=]() { onModelStateChanged(m_allModel->checkedState());}); connect(m_core, SIGNAL(metaJobProgress(int)), this, SLOT(onProgressChanged(int))); connect(m_core, SIGNAL(metaJobInfoMessage(QString)), this, SLOT(setMessage(QString))); -- cgit v1.2.3