Fix kcm_solid_actions crash by expecting QList item relocation
In Qt 6, QList is synonymous with QVector and has different behavior in terms of item storage compared to Qt 5. In this particular case, ActionItem relied on the fact that list items in configGroups would always retain the same address as when initially inserted. This assumption turns out to be wrong, the item gets moved and the original address is now an invalid dangling pointer. In order to avoid crashes from dereferencing invalid pointers, we can store the index of the item in configGroups instead of its address. ActionItem::configItem() gets reshuffled a little bit to accommodate for this change, and also for some extra clarity. As a result, the KCM now starts again without crashing.
Please register or sign in to comment