summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/componentmodel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move non-ui related functionality to coreKatja Marttila2024-02-231-1/+17
| | | | | | | | We need to access the core functionality despite of what user interface is used. Change-Id: I6c4c7e8526ff24a479128061aa40fba66e61660c Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Prevent uninstalling forced componentKatja Marttila2023-12-081-5/+4
| | | | | | | | | | | | | If forced installation is used, then the item is uncheckable. This was not correctly saved to component's internal variable. Also although item is not user checkable, the check state needs to be counted in the model. Uncheckable items might have for example child items and then the uncheckable item is also installed (or uninstalled, depending on selection). Task-number: QTIFW-2589 Change-Id: I9ea967e34cf3f2048312fb5eacd6d0b397d7215c Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Merge remote-tracking branch 'origin/4.5'Arttu Tarkiainen2023-01-271-2/+8
|\ | | | | | | Change-Id: I07baba6a0e64b6022e6a933708e199551be7dd2f
| * Show check box for AutoDependOn components in updater viewArttu Tarkiainen2023-01-261-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In addition to the automatic selection, allow end user to select components declaring the AutoDependOn property when updating components. This does not change the previous rules for automatic selection for update, meaning the component 'A' declaring AutoDependOn relation to component 'B' will still be updated when 'B' is selected for update, regardless of the user selected check state for 'A'. This fixes some cases not handled by the automatic selection, where the component declaring AutoDependOn relation could not be updated. An example scenario: - 'A' (1.0.0) declaring an auto dependency to 'B' does not follow the release schedule and versioning of the component 'B' (2.1.0). - 'A' has a new release (1.0.1) that is pushed to remote repository - The end user cannot update the component 'A' unless 'B' is also updated to the repository, which would trigger the automatic selection Task-number: QTIFW-2855 Change-Id: Iea06c366f7f14f391cbc0b4a6526c8aee349ae59 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* | Merge remote-tracking branch 'origin/4.5' into masterKatja Marttila2022-12-131-26/+12
|\| | | | | | | Change-Id: Id8121e6b4cdda23c8c44cf779e35dce8d9a28090
| * Cleanup installer calculator classesKatja Marttila2022-11-301-26/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 enabled navigation buttons while metadata fetch is still in progressArttu Tarkiainen2022-11-111-1/+7
|/ | | | | | | | | | This allowed the user to erroneously proceed forward with the installation even when the metadata fetch for newly selected categories was not finished. Task-number: QTIFW-2849 Change-Id: If552b85b3aa8c3ee9246328f12a72fbdaba8b797 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Do not emit dataChanged when model check state changesKatja Marttila2022-05-051-15/+6
| | | | | | | | | | | | | | Single items check state is not tracked anywhere else but in the model, so we do not need to send dataChanged -signal to every item when the model check state changes. The correct check state is already set to every item above, so this emit seems unnecessary. This has significant effect on 'Select All', 'Deselect All' and 'Default' -buttons. If there are hundreds of items in the tree, this speeds up the button press in best case over 50 percent. Task-number: QTIFW-2623 Change-Id: If3c2aaebcc0dd6619179c31a51c8a57fdcec5c66 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Speed up component selection in component selection pagesKatja Marttila2022-04-281-19/+22
| | | | | | | | | | | | | | | | | 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>
* Fix segfaults when failing to fetch compressed repositoriesArttu Tarkiainen2022-01-111-3/+3
| | | | | | | | | | | | | | | The ComponentModel object was not always reset in case we already got to the point of clearing the source data (deleted components owned by PackageManagerCore from previous fetch) and failed after that, leaving the model with dangling pointers to the deleted component objects. If we were already on ComponentSelectionPage, this would cause segmentation faults when the component tree view using the model would be shown again after fetch. Task-number: QTIFW-2441 Change-Id: Ie779de5ca0a3c4ae895ea507e6be4a2f7343501e Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Replace obsoleted functionsKatja Marttila2022-01-051-3/+3
| | | | | | | | qSort is obsoleted and std::sort should be used instead. Also QHash insertMulti is obsoleted and QMultiHash should be used instead. Change-Id: Ie4a44355d25d44943a4eeefc2842b4af3e126101 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Fix deprecation warnings from building with Qt 5.15.2Arttu Tarkiainen2021-12-211-1/+3
| | | | | | | | Also update build version requirements. Task-number: QTIFW-2388 Change-Id: Iae1949548dda7a3b8d448228e27060efb5abd8eb Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Add possibility to search for components in ComponentSelectionPageArttu Tarkiainen2021-10-281-9/+0
| | | | | | | | | | | | | | | | | | | Introduce ComponentSortFilterProxyModel, that compared to its base class QSortFilterProxyModel, accepts also child indexes of a source model index which is directly accepted by the filter. Also remove emitting of QAbstractItemModel::dataChanged() for each item in the ComponentModel, which was done regardless of if data at index was changed or not, after reset or when check state or data for any item was changed. If the ComponentModel acts as a source model for a proxy model with 'dynamicSortFilter' property set to true, the extra emits hurt the performance as the model gets filtered again for each source model change. Actual changes done to the ComponentModel are still notified. Task-number: QTIFW-1404 Change-Id: Iea696f8b9abf79d877fb2568488b09dc3cb061be Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* ComponentModel: Fix segfaults on reset when used with a proxy modelArttu Tarkiainen2021-10-281-11/+11
| | | | | | | | | | | | | | | | | | | | | | | Resetting the model is split into two parts - 'ComponentModel ::setRootComponents' updates the root item list and emits 'QAbstractItemModel::modelReset' which was connected to a private slot of the class that updates the component check state and then emits 'QAbstractItemModel::dataChanged' for each component index. The issue was that these could be emitted before the proxy model's private slot that catches the source model reset and performs invalidation had been invoked, causing the proxy model's slot reacting to source model data changes to refer previously retrieved source model indexes, which now had invalid information. Fix by moving the post-reset operations to non-slot function 'ComponentModel::postModelReset()' which is called after the 'QAbstractItemModel::modelReset' is emitted, so that any directly connected slots get invoked first. Task-number: QTIFW-1404 Change-Id: If4d55110c93658689787484d0e8a8eb6b6da685d Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Cppcheck: Fix local variable shadowing outer variableKatja Marttila2021-03-091-3/+3
| | | | | Change-Id: Idff9a40c5089b4de7b8afd1c280603601317beda Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Add possibility to move component in component treeKatja Marttila2021-02-111-10/+10
| | | | | | | | | | | | Setting <TreeName> -tag to component.xml will overwrite the default location of component in installer's tree view. This way we can define the component location without a complete repo build. Updates.xml can be directly modified by adding <TreeName> -tag for easy relocation of components. TreeName must be an unique name - it cannot conflict with existing tree name or name. Task-number: QTIFW-594 Change-Id: Ie69f90f1303d932369d566d0d7b4bc0e354505c6 Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
* Doc: Reduce the amount of documentation warningsArttu Tarkiainen2020-09-211-2/+2
| | | | | | | | | | | | Miscellaneous fixes to missing function documentation, undocumented parameters, namespace scope etc. As 5.12.7 based qdoc gives a lot more warnings about code missing documentation, mark undocumented implementation details with \internal command. Also some spelling fixes to related parts of documentation. Task-number: QTIFW-1483 Change-Id: Ibf5d1e5098713acbd152c5b61ea4f46cc11feb4b Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Fix ability to select node which children are unstableKatja Marttila2019-01-091-1/+1
| | | | | | Task-number: QTIFW-1260 Change-Id: If806f62382eb430c858cb483e3bd25562df7b21a Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Replace 0 with nullptrKatja Marttila2019-01-091-1/+1
| | | | | | | Prevents a lot of warnings seen in QtCreator Change-Id: I63bf95aca68a04fc9fd0eecbe29c63e9b9c47efd Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Merge remote-tracking branch 'origin/3.0' into masterKatja Marttila2018-06-061-6/+2
|\ | | | | | | Change-Id: Ia00c88061f15fc9c9517b536609ac3260c0df2ef
| * Fix ForcedInstallation components uninstall in deselectAllKatja Marttila2018-05-171-6/+2
| | | | | | | | | | | | | | | | | | We don't need to check the installed() state here as we do it already when preselecting components in the tree Task-number: QTIFW-1142 Change-Id: I3540a02f39ea7b379db6597c75d7fee76cc4caab Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Merge remote-tracking branch 'origin/3.0' into masterKatja Marttila2018-05-151-2/+6
|\| | | | | | | Change-Id: I09cacedb966eebc3f42a3402b0b3dc4f6dcd9be8
| * Fix nested autodependency uninstallKatja Marttila2018-04-181-2/+6
| | | | | | | | | | | | Task-number: QTIFW-1114 QTBUG-67106 Change-Id: I29cdddaa81657e5fd2b9cbf343e16cc107ce6c18 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Make unstable component text color darkerKatja Marttila2018-04-091-1/+1
| | | | | | | | | | Change-Id: Id4734ea34b910e5abba6743a5e7d73e220e98aea Reviewed-by: Antti Kokko <antti.kokko@qt.io>
* | Add attribute to mark parts of install tree unstableKatja Marttila2018-04-051-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | This commit adds new AllowUnstableComponents configuration. Setting AllowUnstablecomponents to true in config.xml will * allow installing other components when there are errors in scripts * allow installing other components when there are missing dependencies * will mark the 'broken' components uninstallable in treeview Task-number: QTIFW-930 Change-Id: I8d28cf9c4b0401e0bb76795e87d581f39b64f128 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* | Enable expanding items by defaultRiho Pihlak2018-01-031-0/+3
|/ | | | | | | | | | An item can be expanded by default in component tree by setting ExpandedByDefault to true in package.xml file. Change-Id: Ib324327cf6ef6e2dda3271e704f3ced523c6579c Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Katja Marttila <katja.marttila@qt.io>
* Change 'Checkable' element behaviorKatja Marttila2017-05-221-1/+7
| | | | | | | | Althogh 'Checkable' value is set to package, that can contain packages to install. Enabling the install of components using 'Checkable' value. Change-Id: I05d65fe2da65644872d46bdef3accd5e3f16ad31 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
* Merge remote-tracking branch 'origin/2.0'Katja Marttila2017-01-301-17/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Changelog dist/config/config.xml dist/packages/org.qtproject.ifw.binaries/meta/package.xml dist/packages/org.qtproject.ifw/meta/package.xml installerfw.pri src/libs/installer/lib7z_create.h src/libs/kdtools/kdgenericfactory.cpp src/libs/kdtools/kdgenericfactory.h src/libs/kdtools/kdupdaterapplication.cpp src/libs/kdtools/kdupdaterapplication.h src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp src/libs/kdtools/kdupdaterupdatesourcesinfo.h src/libs/kdtools/localpackagehub.cpp src/libs/kdtools/localpackagehub.h src/libs/kdtools/updatefinder.cpp src/libs/kdtools/updatefinder.h tools/binarycreator/resources/mkdmg.sh Change-Id: Iab2513f549832d2e750e77131c673457ab265af4
| * License header update to GPL-EXCEPTKatja Marttila2017-01-261-17/+12
| | | | | | | | | | Change-Id: I6426c4e8f932cf26c6c638dec18d0c12e22972d1 Reviewed-by: Janne Anttila <janne.anttila@theqtcompany.com>
* | Merge remote-tracking branch 'origin/2.0'Iikka Eklund2016-01-201-4/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: installerfw.pri src/libs/kdtools/kdgenericfactory.cpp src/libs/kdtools/kdgenericfactory.h src/libs/kdtools/kdupdaterapplication.cpp src/libs/kdtools/kdupdaterapplication.h src/libs/kdtools/kdupdaterupdatesourcesinfo.cpp src/libs/kdtools/kdupdaterupdatesourcesinfo.h sync.profile Change-Id: Ifdc8b065f89b7e241bd3788ed79768e21888161f
| * 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>
* | Convert to Qt 5 connect syntaxKai Koehne2015-06-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Convert to new signal/slot syntax where it does not make things more complicated: connections where the signal or slot is an overloaded method, or where the receiver method is not in a QObject, are left alone. The new syntax allows compile-time checking of the connection. Change-Id: I2cc3c93b9812797bd67f64a8728569491eeec668 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* | Enable feature live preview of dependenciesjkobus2015-05-071-0/+4
|/ | | | | | | | | This feature is available after setting InstallActionColumnVisible property to true inside config.xml Change-Id: I5071d5c5c4562100a96530c581de01760ca0d2d5 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Don't modify check state of autodependent component when Select AllJarek Kobus2015-04-241-1/+1
| | | | | Change-Id: Id50fc5fa3460ffda62102019b46923b01b8e8745 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Prevent disabled component to be selected using the Select All button.Jonathan Courtois2015-04-101-1/+1
| | | | | | | | | | The Select All button would select disabled component and try to install them, this new check prevent this. Task-number: QTIFW-635 Change-Id: If15f765b2b8c2fcbb66f72f6d27e9b1d3db92e4a Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
* Update CopyrightKai Koehne2015-02-181-7/+7
| | | | | Change-Id: I8dde6629cfd461104364d5cdc255cb54b58283fa Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Doc: edit docs for the ComponentModel classLeena Miettinen2015-02-041-11/+19
| | | | | | | | | | Add missing information. Fix grammar issues and QDoc command issues. Use the phrase "checked state" consistently. Change-Id: I45f5082bdbdbce933735e902ac24c575a1fc13d3 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com> Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
* Don't show checkbox for autodependent componentsjkobus2015-01-231-2/+6
| | | | | | Change-Id: Ia954f6337c188453f05b37725975be98a28d564f Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Show "Forced" component as enabled, but without checkboxjkobus2015-01-211-0/+2
| | | | | | | | | The indication that it will be installed will be shown in second column. Task-number: QTIFW-491 Change-Id: I23407fe9376a375e62a7b56a0284b12e42c83f81 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Introduce InstallAction property for componentjkobus2015-01-191-4/+45
| | | | | | | | | | 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>
* Optimize the loop gathering the parents of component setjkobus2014-12-151-21/+9
| | | | | Change-Id: Ia01398de4d92a8973460afb6d916f34694808bb0 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Documentation updates and fixes.kh2014-12-011-0/+9
| | | | | | Change-Id: Ie9fc9e1c2a0b84082cb48732e270913bc90d9a79 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
* Optimize the code which determines the check state of a parent componentjkobus2014-11-201-8/+11
| | | | | Change-Id: Ia47c95dbee7477deac4d89384950b9bf962b6e6d Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Fix checkbox management in component treejkobus2014-11-201-1/+6
| | | | | | | | | | Qt 5.2 introduced a behavior change (QTBUG-40060) which broke the checkbox management in component tree. Whenever Qt wants to set PartiallyChecked state for any node, we toggle the state instead. Change-Id: I4d8c8300e52b886060395cda86b238a7c1619c3f 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>
* Fix c++ documentation creation. Add, fix inline documentation.kh12014-10-081-28/+41
| | | | | | Change-Id: Idd6805afbf5736eebf03c2d1ca6dae272c519634 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com>
* Rewrite the component getter mess, remove superfluous methods.kh12014-10-061-5/+1
| | | | | | | | Now we can combine some enum values to achieve the same as before with the several getter functions, removes the clutter from the API. Change-Id: I6368b0ff77821ac95d1defaec4af27dd7d383396 Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
* Doc: do not use the deprecated \bold commandLeena Miettinen2014-06-251-6/+8
| | | | | | | | In Qt 5, you should use \b, but in these cases, you should rather use \e, for emphasis, or \c, for code. Change-Id: I68fe20394a180279b107986f4dbf4bc1fa54ede9 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Fix component still visible after it's set "Virtual".kh12014-05-161-0/+12
| | | | | | | | Task-number: QTIFW-466 Change-Id: I6a5e4d0d20703e2d4e867bb2619c82dac0b8a64c Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com>
* Fix broken "Next" button behavior after uncheck/check of a component.kh12013-08-141-2/+8
| | | | | | Change-Id: I7cc36df32594a57442bc316e7c271fc00c0ad4a2 Reviewed-by: Niels Weber <niels.weber@digia.com> Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>