summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/uninstallercalculator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add common base class for the installer calculator classesArttu Tarkiainen2023-02-081-53/+32
| | | | | | | | As the classes already share similar features and public API, it would make sense to inherit a common abstract class to define the interface. Change-Id: I7ed278b1b049b7ec12c4401e55fdf39306b0ab85 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Remove unused component calculation codeArttu Tarkiainen2023-01-311-1/+0
| | | | | Change-Id: Ie8e00f148e0d079db5a8d4c49216cfe81720f7c5 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Support detecting invalid dependency resolutions on component selectionArttu Tarkiainen2023-01-261-12/+40
| | | | | | | | | | | | | | | | | | | | | | IFW could already previously detect circular and missing dependencies by running a precheck calculation when building the component tree. However, there can be also cases of where the user selection results in unsolvable changes to components. One such case was the erroneous possibility to uninstall a component marked with ForcedInstallation, if any of its dependencies was checkable and the user unselected it for uninstallation. Add support for reacting to such errors in the component tree view, displaying a message box about the invalid dependency resolvation error, and blocking further navigation until the component selection passes the dependency calculations. Also attempt some refactoring the related code to simplify the different call sequences resulting in recalculation of the components. Change-Id: I9dc78f858bd4be7932f89f8e14bbfd97fbd3a0f6 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix replaced removal on updateKatja Marttila2022-12-011-1/+2
| | | | | | | | | | If component is replaced with a component which is installed as autodependency to other component, the replaced component was not uninstalled on update. Task-number: QTIFW-2887 Change-Id: Ibad04df765191f0e399c6f6020cdf081dba5d803 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Cleanup installer calculator classesKatja Marttila2022-11-301-55/+28
| | | | | | | | | | | | | | As there are several optimizations done, the single click of component in component selection tree is not slow anymore. Cleaning the code so it is easier to maintain. Basically this revers commit a28cf55b5a5007c0dd952b3012c076d9da329f0f but as there are bug fixes made after that so pure revert could not be done. Task-number: QTIFW-2885 Change-Id: Id486d5dc68c42c31b4848cd19a1761bcfe242db6 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix virtual component uninstallationKatja Marttila2022-11-041-31/+24
| | | | | | | | | | Virtual components were still wrongly calculated for uninstall depending on which order the tree was clicked and whether the component had dependencies to already installed components or components about to be installed. Change-Id: I624fd1139d15d5e16c81365064dcea2392dc13b1 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix uninstallation of needed virtual componentsKatja Marttila2022-09-161-1/+2
| | | | | | | | | In some rare cases, both component to be uninstalled and component to be installed has dependency to same virtual component. In such case the virtual component should not be uninstalled. Change-Id: I3b826693d4a72d6765a5ac1ee9a3957fdf7415da Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix installer crash if already installed virtual components are replacedKatja Marttila2022-06-061-1/+4
| | | | | | | | | | | | If installed component is replaced by another component, core 'categorizes' it under ComponentType::Replacement. By asking PackageManagerCore::componentByName(QString &name) excludes the replaced components. Fixed so that all 'categories' are used when searching the component by its name. Task-number: QTIFW-2672 Change-Id: I8b5528f7ddca777fe9b696c1d0151640730d1b9f Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Do not install new dependencies for installed componentsKatja Marttila2022-05-161-4/+4
| | | | | | | | | | | | | | | | If component is updated to repository, and new dependencies are added, the dependencies should be installed only when fresh install to component is made or the component is updated. This change adds a new LocalDependencies value to component. It keeps track of the dependencies the local installed packages has. Fixes also a bug in uninstallecalculator, where we should also read the dependencies from local installed packages instead of newly introduced repositories. Task-number: QTIFW-2624 Change-Id: I0557e5adf1e87c0a1238cc455cfb2c90f6b05c87 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add documentation for typedefs AutoDependencyHash and DependencyHashKatja Marttila2022-05-021-2/+2
| | | | | | | | Also use the typedefs in the code when possible. Change-Id: Ie5aa55997051afc864de87d58a10db1c33312ff2 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Speed up component selection in component selection pagesKatja Marttila2022-04-281-78/+92
| | | | | | | | | | | | | | | | | 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 <arttu.tarkiainen@qt.io>
* Add install reason why component is uninstalledKatja Marttila2022-03-241-2/+51
| | | | | | | | | | In details view uninstallable and installable components are listed. For installable components a reason is shown why the component is installed. Added similar kind of message for uninstallable components as well. Task-number: QTIFW-2581 Change-Id: Idbf31200793a6c89a4ed4a6fc115f49889b5f9b5 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Do not uninstall needed virtual dependenciesKatja Marttila2022-03-181-4/+5
| | | | | | | | | | | | | | | Virtual dependencies are uninstalled if all dependencies to the component is removed. Virtual dependencies were calculated using recent components in repository, which is wrong as the dependencies may have changed in the repository, causing the dependencies to be uninstalled although those are still needed. Fixed so that the uninstallable virtual components are calculated from repository components if the component is going to be updated, otherwise the dependeny is calculated from the local installed packages. Task-number: QTIFW-2573 Change-Id: If9cc59fa7f453d502ec1883f27273ef604128a6e Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Make Updater -view checkbox selection fasterKatja Marttila2022-01-191-10/+7
| | | | | | | | | | If there are lot of components installed, querying core from component caused unnecessary performance hit. Also replaced the foreach keyword with the preferred C++ range-based loop Task-number: QTIFW-1021 Change-Id: I961439ba14f26fee21f201769a71319b4b98d14b Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix deprecation warnings from building with Qt 5.15.2Arttu Tarkiainen2021-12-211-3/+4
| | | | | | | | Also update build version requirements. Task-number: QTIFW-2388 Change-Id: Iae1949548dda7a3b8d448228e27060efb5abd8eb Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Remove double calculation of uninstall componentsKatja Marttila2021-01-201-0/+5
| | | | | | | | | | This speeds up selecting/unselecting items in updater view around 25 procent. Task-number: QTIFW-1021 Change-Id: Ia50f7f1d47da0f03fbd6d66b6e78482225545230 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Automatically uninstall unneeded virtual componentsMartin Kampas2020-11-041-0/+26
| | | | | | Change-Id: Ifbbfec4449a9f5b0a79269fc7ddfcc1780e762e5 Task-number: QTBUG-76210 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Doc: Remove internal classes and structs from generated documentationArttu Tarkiainen2020-09-211-0/+6
| | | | | | | | | | After migration to using 5.12.7 based qdoc, the generated documentation contains also empty declarations for members of undocumented internal classes. Mark them internal as needed. Task-number: QTIFW-1483 Change-Id: Iad40e4efdd098f09a825ce1c8d0aafcc76bd83bf Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Merge remote-tracking branch 'origin/3.0' into masterKatja Marttila2018-05-151-4/+12
|\ | | | | | | Change-Id: I09cacedb966eebc3f42a3402b0b3dc4f6dcd9be8
| * Fix crash in updater if component does not exist anymoreKatja Marttila2018-05-141-4/+3
| | | | | | | | | | | | Task-number: QTIFW-1140 Change-Id: I2038bb04526d6fbc3b35be67777a1096f80568cf Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
| * Fix nested autodependency uninstallKatja Marttila2018-05-031-4/+5
| | | | | | | | | | | | | | | | Previous commit worked only when --show-virtual-components was uses. Task-number: QTIFW-1114 QTBUG-67106 Change-Id: I6d0649a37095b10ec9fd3a079e020f6a70345c94 Reviewed-by: Antti Kokko <antti.kokko@qt.io>
| * Fix nested autodependency uninstallKatja Marttila2018-04-181-3/+11
| | | | | | | | | | | | Task-number: QTIFW-1114 QTBUG-67106 Change-Id: I29cdddaa81657e5fd2b9cbf343e16cc107ce6c18 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Add support dash (-) symbol in component nameKonstantin Podsvirov2017-12-051-1/+1
|/ | | | | | | | | | | | | | | | | | | Add colon (:) symbol as alternative separator beetwen component name and version to use dash (-) symbol in component name. For names with dash (-) symbol use colon (:) symbol as separator in dependencies between name and version, even if you do not specify a version. Requirement example: package-with-dash:>=1.2.3, stable:1.x, demo:v1.0-rc1, backward-compatibility:. Also add test 'tst_ComponentIdentifier' for check new feature. Task-number: QTIFW-948 Change-Id: I6340c8001dec369ed8d33fcc4a92c7bce660aec1 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* License header update to GPL-EXCEPTKatja Marttila2017-01-261-17/+12
| | | | | Change-Id: I6426c4e8f932cf26c6c638dec18d0c12e22972d1 Reviewed-by: Janne Anttila <janne.anttila@theqtcompany.com>
* Update license headersIikka Eklund2015-12-291-4/+3
| | | | | | | | | Update existing license headers. LGPL -> LGPLv21. Update copyright year as well. Change-Id: Ie1d71f8c68186b8f625f409ddf94691f178093c9 Reviewed-by: Katja Marttila <katja.marttila@theqtcompany.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Update CopyrightKai Koehne2015-02-181-7/+7
| | | | | Change-Id: I8dde6629cfd461104364d5cdc255cb54b58283fa Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Introduce InstallAction property for componentjkobus2015-01-191-6/+0
| | | | | | | | | | Fixes calculation of component size inside maintenance tool. Don't manipulate check state of components while calculating dependencies. Prepare feature: live preview of dependencies. Change-Id: I0485df8383bc9149a996456e09878fc5676bb27b Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Introduce scScript constant and use whenever neededjkobus2014-11-181-1/+1
| | | | | | Change-Id: Icdbd110f4778bbf8fa75cf54a564fcd0bc8f7a49 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Fix the uninstaller calculatorjkobus2014-11-041-71/+48
| | | | | | | | Don't include dependencies which were not installed before. Fix the "Cascade dependencies" test of "solver". Change-Id: I807503840af5c841cde89fdbbfc3f6932d4787b8 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Add LGPLv3 as new licenseKai Koehne2014-10-161-14/+7
| | | | | | | Change-Id: I61158f956894e209dccf83744b4753774676099d Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
* Move the uninstallation calculations into UninstallerCalculatorjkobus2014-10-101-0/+158
Change-Id: I1b398815414430c2fab9a5c611b44e3a92c2fb39 Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>