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

Jakob Leben jakob.leben at gmail.com
Mon May 9 14:31:26 CEST 2011


On Mon, May 9, 2011 at 2:00 PM, Ilkka Ollakka <ileoo at videolan.org> wrote:

> >  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).
>

In fact, none of the elements of the Qt::DropAction enum are appropriate for
the kind of action we are performing here. We are not doing a copy either...
 In that sense I don't see a reason to set the drop action to copy
explicitely.
For the same reason I think we could even respond to any action = omit the
check entirely.

Or we could follow the thinking: ok, copy and move make sense, but link
action doesn't make sense at all, so we would return if ( proposedAction()
== Qt::LinkAction ).

The set of possibleActions() is changed according to keyboard modifiers. All
that really matters is just that a simple d&d without any modifiers pressed
gets through and enqueues/plays the dropped media.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110509/d8fab9d8/attachment.html>


More information about the vlc-devel mailing list