D24615: Fix crash with sortAllByName/Description
Ahmad Samir
noreply at phabricator.kde.org
Sun Oct 13 17:58:08 BST 2019
ahmadsamir created this revision.
ahmadsamir added a reviewer: mlaurent.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
ahmadsamir requested review of this revision.
REVISION 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
REPOSITORY
R103 KMenu Editor
BRANCH
ahmad/takechildren-crash-on-index-rootItem (branched from master)
REVISION DETAIL
https://phabricator.kde.org/D24615
AFFECTED FILES
treeview.cpp
To: ahmadsamir, mlaurent
Cc: plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20191013/65cd0a3d/attachment.html>
More information about the Plasma-devel
mailing list