From: Ludovic Fauvet Date: Wed, 22 Apr 2009 15:50:38 +0000 (+0200) Subject: Avoid MoveEvent action in Drag&Drop X-Git-Tag: 1.0.0-rc1~274 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=6661270193cc9d9b8da61ce1579b76d0e9af49fd;p=vlc Avoid MoveEvent action in Drag&Drop Close #2672 Signed-off-by: Jean-Baptiste Kempf --- diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp index f2090385d9..76784947aa 100644 --- a/modules/gui/qt4/main_interface.cpp +++ b/modules/gui/qt4/main_interface.cpp @@ -1095,6 +1095,10 @@ void MainInterface::dropEvent(QDropEvent *event) void MainInterface::dropEventPlay( QDropEvent *event, bool b_play ) { + event->setDropAction( Qt::CopyAction ); + if( !event->possibleActions() & Qt::CopyAction ) + return; + const QMimeData *mimeData = event->mimeData(); /* D&D of a subtitles file, add it on the fly */ @@ -1107,7 +1111,7 @@ void MainInterface::dropEventPlay( QDropEvent *event, bool b_play ) mimeData->urls()[0].toLocalFile() ) ), true ) ) { - event->acceptProposedAction(); + event->accept(); return; } } @@ -1125,7 +1129,7 @@ void MainInterface::dropEventPlay( QDropEvent *event, bool b_play ) RecentsMRL::getInstance( p_intf )->addRecent( s ); } } - event->acceptProposedAction(); + event->accept(); } void MainInterface::dragEnterEvent(QDragEnterEvent *event) {