[vlc-devel] commit: Avoid MoveEvent action in Drag&Drop (Ludovic Fauvet )

git version control git at videolan.org
Wed Apr 22 18:54:03 CEST 2009


vlc | branch: master | Ludovic Fauvet <etix at l0cal.com> | Wed Apr 22 17:50:38 2009 +0200| [6661270193cc9d9b8da61ce1579b76d0e9af49fd] | committer: Jean-Baptiste Kempf 

Avoid MoveEvent action in Drag&Drop

Close #2672
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6661270193cc9d9b8da61ce1579b76d0e9af49fd
---

 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 f209038..7678494 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)
 {




More information about the vlc-devel mailing list