]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/prefs_widgets.m
macosx: Merge the KillerThread and the manage thread. Make sure we properly exit...
[vlc] / modules / gui / macosx / prefs_widgets.m
index bf5c6d36116edb3039cecbcdb497e86cc2ea988e..afa4c53b7eb30cfad6d2c5f12efdcd8b8c25d47a 100644 (file)
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <string.h>
 
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
 #include "vlc_keys.h"
 
 #include "intf.h"
     if( self != nil )
     {
         p_item = _p_item;
-        psz_name = strdup( p_item->psz_name );
+        psz_name = p_item->psz_name;
         o_label = NULL;
         i_type = p_item->i_type;
         i_view_type = 0;
 - (void)dealloc
 {
     if( o_label ) [o_label release];
-    if( psz_name ) free( psz_name );
+    free( psz_name );
     [super dealloc];
 }
 
                       withView: (NSView *)o_parent_view
 {
     VLCConfigControl *p_control = NULL;
-    /* Skip depracated options */
-    if( _p_item->psz_current )
-    {
-        return NULL;
-    }
 
     switch( _p_item->i_type )
     {
                 if( !strcmp( module_GetObjName( p_parser ), "main" ) )
                     continue;
                 unsigned int confsize;
+                unsigned int unused;
                 module_GetConfig( p_parser, &confsize );
                 for ( i = 0; i < confsize; i++ )
                 {
-                    module_config_t *p_config = module_GetConfig( p_parser, NULL ) + i;
+                    module_config_t *p_config = module_GetConfig( p_parser, &unused ) + i;
                     /* Hack: required subcategory is stored in i_min */
                     if( p_config->i_type == CONFIG_SUBCATEGORY &&
                         p_config->value.i == p_item->min.i )
 
             if( !strcmp( module_GetObjName( p_parser ), "main" ) )
                 continue;
-            unsigned int confsize;
+            unsigned int confsize, unused;
             module_GetConfig( p_parser, &confsize );
             for ( i = 0; i < confsize; i++ )
             {
-                module_config_t *p_config = module_GetConfig( p_parser, NULL ) + i;
+                module_config_t *p_config = module_GetConfig( p_parser, &unused ) + i;
                 /* Hack: required subcategory is stored in i_min */
                 if( p_config->i_type == CONFIG_SUBCATEGORY &&
                     p_config->value.i == p_item->min.i )
             unsigned int i;
             o_keys_menu = [[NSMenu alloc] initWithTitle: @"Keys Menu"];
             for ( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++)
-                if( vlc_keys[i].psz_key_string && *vlc_keys[i].psz_key_string )
+                if( vlc_keys[i].psz_key_string )
                     POPULATE_A_KEY( o_keys_menu,
-                        [NSString stringWithCString:vlc_keys[i].psz_key_string]
+                        [NSString stringWithUTF8String:vlc_keys[i].psz_key_string]
                         , vlc_keys[i].i_key_code)
         }
         [o_popup setMenu:[o_keys_menu copyWithZone:nil]];
@@ -2058,7 +2058,8 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
 
         for ( i = 0; i < confsize; i++ )
         {
-            module_config_t *p_config = module_GetConfig( p_parser, NULL ) + i;
+            unsigned int unused;
+            module_config_t *p_config = module_GetConfig( p_parser, &unused ) + i;
             NSString *o_modulelongname, *o_modulename;
             NSNumber *o_moduleenabled = nil;
 
@@ -2144,7 +2145,7 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
     [o_dataCell setTitle:@""];
     [o_dataCell setFont:[NSFont systemFontOfSize:0]];
     NSTableColumn *o_tableColumn = [[NSTableColumn alloc]
-        initWithIdentifier:[NSString stringWithCString: "Enabled"]];
+        initWithIdentifier:@"Enabled"];
     [o_tableColumn setHeaderCell: o_headerCell];
     [o_tableColumn setDataCell: o_dataCell];
     [o_tableColumn setWidth:17];
@@ -2154,7 +2155,7 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
     o_dataCell = [[NSTextFieldCell alloc] init];
     [o_dataCell setFont:[NSFont systemFontOfSize:12]];
     o_tableColumn = [[NSTableColumn alloc]
-        initWithIdentifier:[NSString stringWithCString: "Module"]];
+        initWithIdentifier:@"Module"];
     [o_tableColumn setHeaderCell: o_headerCell];
     [o_tableColumn setDataCell: o_dataCell];
     [o_tableColumn setWidth:388 - 17];
@@ -2314,11 +2315,9 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
 - (id)tableView:(NSTableView *)aTableView
     objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
 {
-    if( [[aTableColumn identifier] isEqualToString:
-        [NSString stringWithCString:"Enabled"]] )
+    if( [[aTableColumn identifier] isEqualToString: @"Enabled"] )
         return [[o_modulearray objectAtIndex:rowIndex] objectAtIndex:2];
-    if( [[aTableColumn identifier] isEqualToString:
-        [NSString stringWithCString:"Module"]] )
+    if( [[aTableColumn identifier] isEqualToString: @"Module"] )
         return [[o_modulearray objectAtIndex:rowIndex] objectAtIndex:1];
 
     return nil;