summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/installercalculator.h
Commit message (Collapse)AuthorAgeFilesLines
* Add support for component aliasesArttu Tarkiainen2023-09-141-0/+9
| | | | | | | | | | | | | | | | | | Introduce concept of component aliases, which act as an alternative way for referring a set of related components. Component aliases are declared in an alias definition file, which is included to the created installer's binary layout as a resource. The file lists the available aliases, including metadata - such as name, version, and description - and the list of components and other aliases the alias requires. Aliases can be referred only from the CLI for the time being, with the supported commands 'install' and 'search'. Task-number: QTIFW-2978 Change-Id: I281f171cc7d932ce496051d7090ae169a4709eec Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add common base class for the installer calculator classesArttu Tarkiainen2023-02-081-30/+10
| | | | | | | | 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>
* Cleanup installer calculator classesKatja Marttila2022-11-301-16/+11
| | | | | | | | | | | | | | 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>
* Optimize retrieving components by nameArttu Tarkiainen2022-10-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The PackageManagerCore::componentByName(const QString &name) -function is called repeatedly by the InstallerCalculator class and at minimum once for each install script, because we automatically inject a snippet which stores the return value of the function in the 'component' variable for the script context. Create a <name, component> hash once per each component model reset to make the lookups faster: * This avoids constructing a flat list of components and all their descendants again and again when calling the function. * The linear lookup from the component list is slow because it calls componentMatches() for each element until the satisfactory component was found or the list ends. * The average time complexity of the key lookup from the QHash is constant even for large hashes. Task-number: QTIFW-2790 Change-Id: I580d28f78ac6681d5bcbfbad970002b49de1a830 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix bug when installer is not installing required componentsKatja Marttila2022-06-201-0/+1
| | | | | | | | | | | | | | | | | | | Components can be requested to install by several components using dependency. Components should have a reference count to inform how many components are requesting the install, so that the component can be removed from install when nobody has requested it, or user has not explicitly selected it for install. Dependency reference count was not calculated correctly, user selection was ignored if component was already added as dependency. Also if component which is added as dependency is also autodependency to same component should not increase the reference count, as the component is uninstalled when the reference count is zero. Having both autodependency and dependency would never cause the reference count to be zero. Task-number: QTIFW-2708 Change-Id: I398bc892f6626d76c872402d8ab55cb8115112ae Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix updating autodependency componentsKatja Marttila2022-05-131-1/+2
| | | | | | | | | | | Autodependency components were always forcely updated, even if 'Deselect All' was selected in component selection page. Fixed so that the autodependency component update is updated only when one of its dependants is updated. Task-number: QTIFW-2595 Change-Id: I05ececc45ef32ff80d53b008f839b358158a3316 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add documentation for typedefs AutoDependencyHash and DependencyHashKatja Marttila2022-05-021-2/+3
| | | | | | | | 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-15/+24
| | | | | | | | | | | | | | | | | 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>
* Make installer to check the dependency versionKatja Marttila2017-03-231-2/+2
| | | | | | | | | | | | | | Installer was able to install dependency correctly. However, it ignored the version dependency might have. Dependencies>componentA->=4.0</Dependencies> If there was already a dependency installed with lower version number, the newer version, which was required by the selected component, was not installed. Fixed so that maintenancetool will not only check if the dependency is installed but also the installed version. Change-Id: Ia26b5233cf8847bce73095d19a13c481318d27f2 Task-number: QTIFW-914 Reviewed-by: Iikka Eklund <iikka.eklund@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>
* 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 InstallerCalculator into its own headerkh12014-10-061-0/+98
Make it public, so that it can be used outside (e.g. in tests) Change-Id: I2a307dcd6f2eb017f9ac26de06d77deb0d668fbe Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>