Commit 6006454c authored by Felix Paul Kühne's avatar Felix Paul Kühne Committed by Felix Paul Kühne

macosx: code optimizations - no functional change

(cherry picked from commit 5f138ac2342473dba543d797c7592e6757289b05)
parent 3120c637
/***************************************************************************** /*****************************************************************************
* simple_prefs.m: Simple Preferences for Mac OS X * 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$ * $Id$
* *
* Authors: Felix Paul Kühne <fkuehne at videolan dot org> * 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 ...@@ -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_config_t *p_item;
module_t *p_parser, **p_list; module_t *p_parser, **p_list;
NSString * objectTitle = [[object selectedItem] title];
p_item = config_FindConfig( VLC_OBJECT(p_intf), name ); 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 ...@@ -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( 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 ))); config_PutPsz( p_intf, name, strdup( module_get_object( p_parser )));
break; break;
...@@ -817,7 +818,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch ...@@ -817,7 +818,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
} }
} }
module_list_free( p_list ); module_list_free( p_list );
if( [[[object selectedItem] title] isEqualToString: _NS( "Default" )] ) if( [objectTitle isEqualToString: _NS( "Default" )] )
config_PutPsz( p_intf, name, "" ); config_PutPsz( p_intf, name, "" );
} }
...@@ -1335,13 +1336,15 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch ...@@ -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 - (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]; return [o_hotkeyDescriptions objectAtIndex: rowIndex];
else if( [[aTableColumn identifier] isEqualToString: @"shortcut"] ) else if( [identifier isEqualToString: @"shortcut"] )
return [self OSXStringKeyToString:[o_hotkeySettings objectAtIndex: rowIndex]]; return [self OSXStringKeyToString:[o_hotkeySettings objectAtIndex: rowIndex]];
else else
{ {
msg_Err( p_intf, "unknown TableColumn identifier (%s)!", [[aTableColumn identifier] UTF8String] ); msg_Err( p_intf, "unknown TableColumn identifier (%s)!", [identifier UTF8String] );
return NULL; return NULL;
} }
} }
...@@ -1413,15 +1416,16 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch ...@@ -1413,15 +1416,16 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
NSString *keyString = [o_theEvent characters]; NSString *keyString = [o_theEvent characters];
unichar key = [keyString characterAtIndex:0]; unichar key = [keyString characterAtIndex:0];
NSUInteger i_modifiers = [o_theEvent modifierFlags];
/* modifiers */ /* modifiers */
if( [o_theEvent modifierFlags] & NSControlKeyMask ) if( i_modifiers & NSControlKeyMask )
[tempString appendString:@"Ctrl-"]; [tempString appendString:@"Ctrl-"];
if( [o_theEvent modifierFlags] & NSAlternateKeyMask ) if( i_modifiers & NSAlternateKeyMask )
[tempString appendString:@"Alt-"]; [tempString appendString:@"Alt-"];
if( [o_theEvent modifierFlags] & NSShiftKeyMask ) if( i_modifiers & NSShiftKeyMask )
[tempString appendString:@"Shift-"]; [tempString appendString:@"Shift-"];
if( [o_theEvent modifierFlags] & NSCommandKeyMask ) if( i_modifiers & NSCommandKeyMask )
[tempString appendString:@"Command-"]; [tempString appendString:@"Command-"];
/* non character keys */ /* non character keys */
......
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