vlc/vlc-1.1 | branch: master | Felix Paul Kühne <[email protected]> | Sun 
Apr 10 17:23:41 2011 +0200| [d15f96b05954f082c008ec40975883e8977c95ed] | 
committer: Felix Paul Kühne

macosx: make sure to generate a complete list of hotkeys in the sprefs

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

 NEWS                              |    1 +
 modules/gui/macosx/simple_prefs.m |   31 ++++++++++++++++++++-----------
 2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/NEWS b/NEWS
index 79ffe59..3700cfd 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ Mac OS X Interface:
  * fixed bugs in the Streaming / Transcoding wizard
  * improved Apple Remote handling
  * layout fixes in the Preferences and Controls windows
+ * fixed incomplete list of hotkeys in the Preferences dialog
 
 Mac OS X Port:
  * fixed Growl local notification plugin
diff --git a/modules/gui/macosx/simple_prefs.m 
b/modules/gui/macosx/simple_prefs.m
index a386429..42d2702 100644
--- a/modules/gui/macosx/simple_prefs.m
+++ b/modules/gui/macosx/simple_prefs.m
@@ -645,23 +645,32 @@ static inline char * __config_GetLabel( vlc_object_t 
*p_this, const char *psz_na
     /********************
      * hotkeys settings *
      ********************/
-    const struct hotkey *p_hotkeys = p_intf->p_libvlc->p_hotkeys;
     [o_hotkeySettings release];
     o_hotkeySettings = [[NSMutableArray alloc] init];
     NSMutableArray *o_tempArray_desc = [[NSMutableArray alloc] init];
-    i = 1;
 
-    while( i < 100 )
-    {
-        p_item = config_FindConfig( VLC_OBJECT(p_intf), 
p_hotkeys[i].psz_action );
-        if( !p_item )
-            break;
-
-        [o_tempArray_desc addObject: _NS( p_item->psz_text )];
-        [o_hotkeySettings addObject: [NSNumber numberWithInt: 
p_item->value.i]];
+    module_t *p_main = module_get_main();
+    assert( p_main );
+    unsigned confsize;
+    module_config_t *p_config;
 
-        i++;
+    p_config = module_config_get (p_main, &confsize);
+    
+    for (size_t i = 0; i < confsize; i++)
+    {
+        module_config_t *p_item = p_config + i;
+        
+        if( (p_item->i_type & CONFIG_ITEM) && p_item->psz_name != NULL
+           && !strncmp( p_item->psz_name , "key-", 4 )
+           && !EMPTY_STR( p_item->psz_text ) )
+        {
+            [o_tempArray_desc addObject: _NS( p_item->psz_text )];
+            [o_hotkeySettings addObject: [NSNumber 
numberWithInt:p_item->value.i]];
+        }
     }
+    module_config_free (p_config);
+    module_release (p_main);
+
     [o_hotkeyDescriptions release];
     o_hotkeyDescriptions = [[NSArray alloc] initWithArray: o_tempArray_desc 
copyItems: YES];
     [o_tempArray_desc release];

_______________________________________________
vlc-commits mailing list
[email protected]
http://mailman.videolan.org/listinfo/vlc-commits

Reply via email to