]> git.sesse.net Git - vlc/commitdiff
Qt4: cleanup
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 17 Mar 2009 17:12:31 +0000 (19:12 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 17 Mar 2009 17:14:21 +0000 (19:14 +0200)
modules/gui/qt4/menus.cpp

index 8863a4d68719d841ebeda810e9c623a05a9d6e3d..1edb36899f36f7d6fc4acdda357aa00063040699 100644 (file)
@@ -877,21 +877,18 @@ void QVLCMenu::MiscPopupMenu( intf_thread_t *p_intf )
 /* Main Menu that sticks everything together  */
 void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
 {
-    /* Destroy popup menu if there is one */
+    /* Delete old popup if there is one */
+    if( p_intf->p_sys->p_popup_menu )
+        delete p_intf->p_sys->p_popup_menu;
+
     if( !show )
     {
-        delete p_intf->p_sys->p_popup_menu;
         p_intf->p_sys->p_popup_menu = NULL;
         return;
     }
 
-    /* Delete and recreate a popup if there is one */
-    if( p_intf->p_sys->p_popup_menu )
-        delete p_intf->p_sys->p_popup_menu;
-
     /* */
     QMenu *menu = new QMenu();
-    QMenu *submenu;
     QAction *action;
     bool b_isFullscreen = false;
     MainInterface *mi = p_intf->p_sys->p_mi;
@@ -904,6 +901,7 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
 
     if( p_input )
     {
+        QMenu *submenu;
         vout_thread_t *p_vout = THEMIM->getVout();
 
         /* Add a fullscreen switch button, since it is the most used function */
@@ -951,7 +949,7 @@ void QVLCMenu::PopupMenu( intf_thread_t *p_intf, bool show )
     /* Add some special entries for windowed mode: Interface Menu */
     if( !b_isFullscreen )
     {
-        submenu = new QMenu( qtr( "Interface" ), menu );
+        QMenu *submenu = new QMenu( qtr( "Interface" ), menu );
         QMenu *tools = ToolsMenu( submenu );
         submenu->addSeparator();