Port away from NetAccess
Review Request #128412 - Created July 9, 2016 and submitted
|Martin Tobias Holmedahl Sandsmark|
Port away from NetAccess, also ensure that we don't interact with the drop event as much as possible after we've run the event loop.
The port seems fine, you can commit it as is if you want, it's not worse than before.
My suggestions would improve the code but are all about issues that were already there.
Running an event loop in a dropEvent is a dangerous recipe. The dropevent data gets deleted by Qt at some point in that duration, this has bitten me in the past (for KIO::paste, where the event loop can of course last for much longer than here, since there we wait for the user to reply to a modal dialog).
I suppose this is probably fine (apart from the mouseButtons() test happening after the event loop), but it would be much cleaner/safer to move the decodeFolder() code and following to a slot.
I wonder why this doesn't use the proposedAction from the dropEvent instead of checking for ControlModifier directly (which is going to be wrong when there's an event loop in between)...
Same issue here, exec() followed by mouseButtons().
At least the call to mouseButtons() could be done at the beginning of the method....