[vlc-commits] Qt: fix toolbar customization when doing back and forth

Jean-Baptiste Kempf git at videolan.org
Thu Dec 6 18:34:53 CET 2012


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Dec  6 18:32:42 2012 +0100| [22faed61d33d747226e5238466c30b56a9fec4f3] | committer: Jean-Baptiste Kempf

Qt: fix toolbar customization when doing back and forth

Close #7543

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

 modules/gui/qt4/dialogs/toolbar.cpp |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/modules/gui/qt4/dialogs/toolbar.cpp b/modules/gui/qt4/dialogs/toolbar.cpp
index bf325aa..34c39ac 100644
--- a/modules/gui/qt4/dialogs/toolbar.cpp
+++ b/modules/gui/qt4/dialogs/toolbar.cpp
@@ -722,11 +722,6 @@ void DroppingController::dropEvent( QDropEvent *event )
 {
     int i = getParentPosInLayout( event->pos() );
 
-    /* Workaround: do not let the item move to its current
-       position + 1 as it breaks the widgetList */
-    if ( i - 1 == i_dragIndex )
-        --i;
-
     QByteArray data = event->mimeData()->data( "vlc/button-bar" );
     QDataStream dataStream(&data, QIODevice::ReadOnly);
 
@@ -800,11 +795,11 @@ bool DroppingController::eventFilter( QObject *obj, QEvent *event )
             /* Remove before the drag to not mess DropEvent,
                that will createAndAddWidget */
             widgetList.removeAt( i );
+            controlLayout->removeWidget( widg );
+            widg->hide();
 
             /* Start the effective drag */
             drag->exec(Qt::CopyAction | Qt::MoveAction, Qt::MoveAction);
-            widg->hide();
-            controlLayout->removeWidget( widg );
             b_draging = false;
             }
             return true;



More information about the vlc-commits mailing list