[vlc-devel] commit: Qt: fix crash in customize toolbar dialog. (Jean-Baptiste Kempf )

git version control git at videolan.org
Fri Jul 24 12:16:15 CEST 2009


vlc | branch: 1.0-bugfix | Jean-Baptiste Kempf <jb at videolan.org> | Fri Jul 24 12:15:13 2009 +0200| [25d37a4930519c5bcabbe2c0fae8c86e38d9ea54] | committer: Jean-Baptiste Kempf 

Qt: fix crash in customize toolbar dialog.

For some reasons, this doesn't crash on Linux...

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

 modules/gui/qt4/dialogs/toolbar.cpp |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/modules/gui/qt4/dialogs/toolbar.cpp b/modules/gui/qt4/dialogs/toolbar.cpp
index b2f62b8..f08926b 100644
--- a/modules/gui/qt4/dialogs/toolbar.cpp
+++ b/modules/gui/qt4/dialogs/toolbar.cpp
@@ -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 */




More information about the vlc-devel mailing list