Review Request 114562: Fix crash when dragging a file from an expanded folder (regression in master)
Frank Reininghaus
frank78ac at googlemail.com
Fri Dec 20 10:07:53 GMT 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/114562/
-----------------------------------------------------------
Review request for Dolphin.
Repository: kde-baseapps
Description
-------
I just found out that there is a problem with https://git.reviewboard.kde.org/r/113515/ : The while-loop that is supposed to iterate through the parents of an item in order to find out if one of them is part of the QMimeData already (because it's not necessary to add the child item in that case) does not really iterate through the parents, but replaces itemData by its parent repeatedly, until itemData eventually becomes 0, and we get a segfault.
To reproduce, expand a folder, select an item inside the folder, but not the folder itself, and drag or copy the selected file.
Replacing "itemData = itemData->parent;" by "parent = parent->parent;" fixes the problem.
If noone sees a problem with this patch, I'll push it very soon to prevent that more people find out about this bug the hard way. I'll push the new unit test also to KDE/4.12 (I should really have written some tests for createMimeData() before changing that function).
Diffs
-----
dolphin/src/kitemviews/kfileitemmodel.cpp 4521374
dolphin/src/tests/CMakeLists.txt 9b152ed
dolphin/src/tests/kfileitemmodeltest.cpp 62ff4fa
Diff: http://git.reviewboard.kde.org/r/114562/diff/
Testing
-------
Fixes the crash. Old and new unit tests pass.
Thanks,
Frank Reininghaus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20131220/2bd362fd/attachment.htm>
More information about the kfm-devel
mailing list