Commit bfcd282a authored by Felix Paul Kühne's avatar Felix Paul Kühne Committed by Jean-Baptiste Kempf

macosx: further optimize the menu re-creation on 10.6+

(cherry picked from commit 6a8197f657f1ef74e358864209b1ed4db37ff078)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent f4aba3c9
...@@ -481,10 +481,8 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -481,10 +481,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
if( [o_mi_screen hasSubmenu] ) if( [o_mi_screen hasSubmenu] )
{ {
y = [[o_mi_screen submenu] numberOfItems] - 1; y = [[o_mi_screen submenu] numberOfItems] - 1;
msg_Dbg( VLCIntf, "%i items in submenu", y );
while( x != y ) while( x != y )
{ {
msg_Dbg( VLCIntf, "removing item %i of %i", x, y );
[[o_mi_screen submenu] removeItemAtIndex: x]; [[o_mi_screen submenu] removeItemAtIndex: x];
x++; x++;
} }
...@@ -927,12 +925,21 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -927,12 +925,21 @@ static VLCMainMenu *_o_sharedInstance = nil;
selector:(SEL)pf_callback selector:(SEL)pf_callback
{ {
vlc_value_t val, val_list, text_list; vlc_value_t val, val_list, text_list;
int i_type, i, i_nb_items; int i_type, i;
/* remove previous items */ /* remove previous items */
if (OSX_LEOPARD)
{
int i_nb_items;
i_nb_items = [o_menu numberOfItems]; i_nb_items = [o_menu numberOfItems];
for( i = 0; i < i_nb_items; i++ ) for( i = 0; i < i_nb_items; i++ )
[o_menu removeItemAtIndex: 0]; [o_menu removeItemAtIndex: 0];
}
else
{
/* this is more efficient then the legacy code, but 10.6+ only */
[o_menu removeAllItems];
}
/* Check the type of the object variable */ /* Check the type of the object variable */
i_type = var_Type( p_object, psz_variable ); i_type = var_Type( p_object, psz_variable );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment