[vlc-devel] Qt: open media file via drag&drop

Ilkka Ollakka ileoo at videolan.org
Mon May 9 14:00:13 CEST 2011

On Sat, May 07, 2011 at 10:12:20PM +0200, Jakob Leben wrote:


> The change in behavior from 1.1.x to current was introduced in commit
> [eeb1cf53993].
> Indeed, the previous behavior must have let through other actions than
> Qt::CopyAction, while the current doesn't.
> I don't see any reason for not responding to MoveAction as well. And I don't
> see any reason for setting the action in MainInterface::dropEventPlay either,
> as the drop event will be consumed and not processed any further so after
> responding to the event it really doesn't matter what the action is anymore.

> I propose the attached patch.

> ---
>  modules/gui/qt4/main_interface.cpp |    5 +----

>  void MainInterface::dropEventPlay( QDropEvent *event, bool b_play )
>  {
> -    if( event->possibleActions() & Qt::CopyAction )
> -       event->setDropAction( Qt::CopyAction );
> -    else
> -        return;
> +    if( !( event->possibleActions() & (Qt::CopyAction | Qt::MoveAction) ) ) return;

Seem ok, but I would like to keep that setDropAction( Qt::CopyAction )
in this case when we accept other actions too for just in case and it
would keep in mind that we don't do move-handling in that code (even if
it's pretty clear in current code).

Ilkka Ollakka
Machine-Independent, adj.:
	Does not run on any existing machine.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110509/c76bb899/attachment.sig>

More information about the vlc-devel mailing list