]> git.sesse.net Git - vlc/commitdiff
Qt: fix crash in customize toolbar dialog.
authorJean-Baptiste Kempf <jb@videolan.org>
Fri, 24 Jul 2009 10:15:13 +0000 (12:15 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 24 Jul 2009 10:18:55 +0000 (12:18 +0200)
For some reasons, this doesn't crash on Linux...
(cherry picked from commit 25d37a4930519c5bcabbe2c0fae8c86e38d9ea54)

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/qt4/dialogs/toolbar.cpp

index 68e501e8508ac2fa57edf9abe2b0941bcc1e1ec0..f57b8f7c604edbaa6b0a78a0efcdbe52667a6c4f 100644 (file)
@@ -647,16 +647,14 @@ inline int DroppingController::getParentPosInLayout( QPoint point )
     QPoint origin = mapToGlobal ( point );
 
     QWidget *tempWidg = QApplication::widgetAt( origin );
+    if( tempWidg == NULL )
+        return -1;
 
-    int i = -1;
-    if( tempWidg != NULL)
+    int i = controlLayout->indexOf( tempWidg );
+    if( i == -1 )
     {
-        i = controlLayout->indexOf( tempWidg );
-        if( i == -1 )
-        {
-            i = controlLayout->indexOf( tempWidg->parentWidget() );
-            tempWidg = tempWidg->parentWidget();
-        }
+        i = controlLayout->indexOf( tempWidg->parentWidget() );
+        tempWidg = tempWidg->parentWidget();
     }
 
     /* Return the nearest position */