[vlc-devel] commit: Avoid MoveEvent action in Drag&Drop (Ludovic Fauvet )
git version control
git at videolan.org
Wed Apr 22 18:55:45 CEST 2009
vlc | branch: 0.9-bugfix | Ludovic Fauvet <etix at l0cal.com> | Wed Apr 22 17:50:38 2009 +0200| [d053f5baf2b9b5f98c44f777fe88ca1085d3a714] | committer: Jean-Baptiste Kempf
Avoid MoveEvent action in Drag&Drop
Close #2672
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 6661270193cc9d9b8da61ce1579b76d0e9af49fd)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d053f5baf2b9b5f98c44f777fe88ca1085d3a714
---
modules/gui/qt4/main_interface.cpp | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 52cdee5..4c6a7d8 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -1058,6 +1058,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 */
@@ -1070,7 +1074,7 @@ void MainInterface::dropEventPlay( QDropEvent *event, bool b_play )
mimeData->urls()[0].toLocalFile() ) ),
true ) )
{
- event->acceptProposedAction();
+ event->accept();
return;
}
}
@@ -1087,7 +1091,7 @@ void MainInterface::dropEventPlay( QDropEvent *event, bool b_play )
first = false;
}
}
- event->acceptProposedAction();
+ event->accept();
}
void MainInterface::dragEnterEvent(QDragEnterEvent *event)
{
More information about the vlc-devel
mailing list