Fix crash with sortAllByName/Description
ClosedPublic

Authored by ahmadsamir on Oct 13 2019, 4:58 PM.

Details

Summary

Calling QTreeWidgetItem::takeChildren() on invisibleRootItem() results
in a crash because it calls QTreeModel::beginRemoveItems() which calls
QTreeModel::index() on that item which returns an invalid QModelIndex.

Instead iterate over topLevelItem's and sort them.

Test Plan
  • Sort all by name/description causes a crash
  • Apply the patch then try again, it should work

Diff Detail

Repository
R103 KMenu Editor
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ahmadsamir created this revision.Oct 13 2019, 4:58 PM
Restricted Application added a project: Plasma. · View Herald TranscriptOct 13 2019, 4:58 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ahmadsamir requested review of this revision.Oct 13 2019, 4:58 PM
mlaurent accepted this revision.Oct 14 2019, 6:32 AM

it seems ok for me.
Thanks

This revision is now accepted and ready to land.Oct 14 2019, 6:32 AM
This revision was automatically updated to reflect the committed changes.