]> git.sesse.net Git - vlc/commitdiff
Avoid MoveEvent action in Drag&Drop
authorLudovic Fauvet <etix@l0cal.com>
Wed, 22 Apr 2009 15:50:38 +0000 (17:50 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 22 Apr 2009 16:35:03 +0000 (18:35 +0200)
Close #2672
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/qt4/main_interface.cpp

index f2090385d9836fbb3ae66b5ca7a55bfa4ba6a7c3..76784947aa9de0e28939ae095584200be47937cd 100644 (file)
@@ -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)
 {