[Folder View] Use a copy of QMimeData in signal handler

Authored by broulik on Jun 4 2017, 2:37 PM.



By the time we leave the method, the QMimeData is deleted by the DragArea's drop event being destroyed leading to a crash.

CHANGELOG: Fixed crash when dropping files on desktop with KDeclarative from KDE Frameworks 5.35

BUG: 380806
FIXED-IN: 5.10.1

Test Plan

There's no copy operator. Stackoverflow mentions some weirdness on Windows [1] but that shouldn't affect us.

  • Can still re-arrange files
  • Dropping an external file prompts to copy/link/move/create matching applet and all of those options work now without a crash

DropJob doesn't always emit popupAboutToShow (when there's only one possible action (e.g. only "move" to trash) where we could leak the QMimeData but this is an issue also for the containment as then we don't get a chance to add possible applet to be added. This needs to be addressed separately in one form or the other.

[1] https://stackoverflow.com/questions/13762140/proper-way-to-copy-a-qmimedata-object

Diff Detail

R119 Plasma Desktop
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Jun 4 2017, 2:37 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJun 4 2017, 2:37 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik edited the test plan for this revision. (Show Details)Jun 4 2017, 2:38 PM
broulik edited the summary of this revision. (Show Details)
hein accepted this revision.Jun 4 2017, 2:41 PM
This revision is now accepted and ready to land.Jun 4 2017, 2:41 PM
This revision was automatically updated to reflect the committed changes.