[vlc-commits] macosx: code optimizations - no functional change
Felix Paul Kühne
git at videolan.org
Mon May 21 14:26:46 CEST 2012
vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu May 17 03:06:52 2012 +0200| [6006454cee9f5b16691093cdf33c160c94a98e6a] | committer: Felix Paul Kühne
macosx: code optimizations - no functional change
(cherry picked from commit 5f138ac2342473dba543d797c7592e6757289b05)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=6006454cee9f5b16691093cdf33c160c94a98e6a
---
modules/gui/macosx/simple_prefs.m | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m
index d419492..7b16fe0 100644
--- a/modules/gui/macosx/simple_prefs.m
+++ b/modules/gui/macosx/simple_prefs.m
@@ -1,7 +1,7 @@
/*****************************************************************************
* simple_prefs.m: Simple Preferences for Mac OS X
*****************************************************************************
-* Copyright (C) 2008-2011 VLC authors and VideoLAN
+* Copyright (C) 2008-2012 VLC authors and VideoLAN
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne at videolan dot org>
@@ -799,6 +799,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
{
module_config_t *p_item;
module_t *p_parser, **p_list;
+ NSString * objectTitle = [[object selectedItem] title];
p_item = config_FindConfig( VLC_OBJECT(p_intf), name );
@@ -809,7 +810,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
if( p_item->i_type == CONFIG_ITEM_MODULE && module_provides( p_parser, p_item->psz_type ) )
{
- if( [[[object selectedItem] title] isEqualToString: _NS( module_GetLongName( p_parser ) )] )
+ if( [objectTitle isEqualToString: _NS( module_GetLongName( p_parser ) )] )
{
config_PutPsz( p_intf, name, strdup( module_get_object( p_parser )));
break;
@@ -817,7 +818,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
}
}
module_list_free( p_list );
- if( [[[object selectedItem] title] isEqualToString: _NS( "Default" )] )
+ if( [objectTitle isEqualToString: _NS( "Default" )] )
config_PutPsz( p_intf, name, "" );
}
@@ -1335,13 +1336,15 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
{
- if( [[aTableColumn identifier] isEqualToString: @"action"] )
+ NSString * identifier = [aTableColumn identifier];
+
+ if( [identifier isEqualToString: @"action"] )
return [o_hotkeyDescriptions objectAtIndex: rowIndex];
- else if( [[aTableColumn identifier] isEqualToString: @"shortcut"] )
+ else if( [identifier isEqualToString: @"shortcut"] )
return [self OSXStringKeyToString:[o_hotkeySettings objectAtIndex: rowIndex]];
else
{
- msg_Err( p_intf, "unknown TableColumn identifier (%s)!", [[aTableColumn identifier] UTF8String] );
+ msg_Err( p_intf, "unknown TableColumn identifier (%s)!", [identifier UTF8String] );
return NULL;
}
}
@@ -1413,15 +1416,16 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
NSString *keyString = [o_theEvent characters];
unichar key = [keyString characterAtIndex:0];
+ NSUInteger i_modifiers = [o_theEvent modifierFlags];
/* modifiers */
- if( [o_theEvent modifierFlags] & NSControlKeyMask )
+ if( i_modifiers & NSControlKeyMask )
[tempString appendString:@"Ctrl-"];
- if( [o_theEvent modifierFlags] & NSAlternateKeyMask )
+ if( i_modifiers & NSAlternateKeyMask )
[tempString appendString:@"Alt-"];
- if( [o_theEvent modifierFlags] & NSShiftKeyMask )
+ if( i_modifiers & NSShiftKeyMask )
[tempString appendString:@"Shift-"];
- if( [o_theEvent modifierFlags] & NSCommandKeyMask )
+ if( i_modifiers & NSCommandKeyMask )
[tempString appendString:@"Command-"];
/* non character keys */
More information about the vlc-commits
mailing list