[vlc-commits] Qt4: remove dead code

Rémi Denis-Courmont git at videolan.org
Sat May 23 10:29:10 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat May 23 11:27:45 2015 +0300| [29ac7d73260375408564f44800120876fd619d64] | committer: Rémi Denis-Courmont

Qt4: remove dead code

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

 modules/gui/qt4/menus.cpp |   14 ++++++--------
 modules/gui/qt4/menus.hpp |    2 +-
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 7351a14..29662f8 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -1220,9 +1220,7 @@ QMenu * VLCMenuBar::Populate( intf_thread_t *p_intf,
  * Private methods.
  *****************************************************************************/
 
-static bool IsMenuEmpty( const char *psz_var,
-                         vlc_object_t *p_object,
-                         bool b_root = true )
+static bool IsMenuEmpty( const char *psz_var, vlc_object_t *p_object )
 {
     /* Check if we want to display the variable */
     if( !(var_Type( p_object, psz_var) & VLC_VAR_HASCHOICE) )
@@ -1230,7 +1228,7 @@ static bool IsMenuEmpty( const char *psz_var,
 
     vlc_value_t val;
     var_Change( p_object, psz_var, VLC_VAR_CHOICESCOUNT, &val, NULL );
-    return val.i_int == 0 || (val.i_int == 1 && b_root);
+    return val.i_int == 0 || val.i_int == 1;
 }
 
 #define TEXT_OR_VAR qfue ( text.psz_string ? text.psz_string : psz_var )
@@ -1322,14 +1320,14 @@ void VLCMenuBar::UpdateItem( intf_thread_t *p_intf, QMenu *menu,
             }
 
             action->setEnabled(
-               CreateChoicesMenu( submenu, psz_var, p_object, true ) == 0 );
+                CreateChoicesMenu( submenu, psz_var, p_object ) == 0 );
             if( forceDisabled )
                 action->setEnabled( false );
         }
         else
         {
             action->setEnabled(
-                CreateChoicesMenu( menu, psz_var, p_object, true ) == 0 );
+                CreateChoicesMenu( menu, psz_var, p_object ) == 0 );
         }
         FREENULL( text.psz_string );
         return;
@@ -1370,7 +1368,7 @@ static bool CheckTitle( vlc_object_t *p_object, const char *psz_var )
 
 
 int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
-        vlc_object_t *p_object, bool b_root )
+                                   vlc_object_t *p_object )
 {
     vlc_value_t val, val_list, text_list;
     int i_type, i;
@@ -1379,7 +1377,7 @@ int VLCMenuBar::CreateChoicesMenu( QMenu *submenu, const char *psz_var,
     i_type = var_Type( p_object, psz_var );
 
     /* Make sure we want to display the variable */
-    if( submenu->isEmpty() && IsMenuEmpty( psz_var, p_object, b_root ) )
+    if( submenu->isEmpty() && IsMenuEmpty( psz_var, p_object ) )
         return VLC_EGENERIC;
 
     switch( i_type & VLC_VAR_TYPE )
diff --git a/modules/gui/qt4/menus.hpp b/modules/gui/qt4/menus.hpp
index efb4f65..3f3d754 100644
--- a/modules/gui/qt4/menus.hpp
+++ b/modules/gui/qt4/menus.hpp
@@ -150,7 +150,7 @@ private:
                                   vlc_value_t, int, bool c = false );
     static void UpdateItem( intf_thread_t *, QMenu *, const char *,
                             vlc_object_t *, bool );
-    static int CreateChoicesMenu( QMenu *,const char *, vlc_object_t *, bool );
+    static int CreateChoicesMenu( QMenu *,const char *, vlc_object_t * );
     static void EnableStaticEntries( QMenu *, bool );
 
     /* recentMRL menu */



More information about the vlc-commits mailing list