From 6661270193cc9d9b8da61ce1579b76d0e9af49fd Mon Sep 17 00:00:00 2001 From: Ludovic Fauvet Date: Wed, 22 Apr 2009 17:50:38 +0200 Subject: [PATCH] Avoid MoveEvent action in Drag&Drop Close #2672 Signed-off-by: Jean-Baptiste Kempf --- modules/gui/qt4/main_interface.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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) { -- 2.39.2