Commit d0d0541e authored by Felix Paul Kühne's avatar Felix Paul Kühne

* withCString is deprecated in 10.4. Use WithUTF8String instead, as VLC's core...

* withCString is deprecated in 10.4. Use WithUTF8String instead, as VLC's core is completely UTF8 now. Remove a couple of (nowadays) useless checks
parent 08557e2e
......@@ -1282,9 +1282,6 @@ static VLCMain *_o_sharedMainInstance = nil;
}
o_temp = [NSString stringWithUTF8String:
p_playlist->status.p_item->p_input->psz_name];
if( o_temp == NULL )
o_temp = [NSString stringWithCString:
p_playlist->status.p_item->p_input->psz_name];
[self setScrollField: o_temp stopAfter:-1];
[[[self getControls] getFSPanel] setStreamTitle: o_temp];
......@@ -1487,9 +1484,6 @@ static VLCMain *_o_sharedMainInstance = nil;
vlc_object_yield( p_input );
o_temp = [NSString stringWithUTF8String:
p_playlist->status.p_item->p_input->psz_name];
if( o_temp == NULL )
o_temp = [NSString stringWithCString:
p_playlist->status.p_item->p_input->psz_name];
[self setScrollField: o_temp stopAfter:-1];
vlc_object_release( p_input );
vlc_object_release( p_playlist );
......
......@@ -109,7 +109,7 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class )
sizeof(psz_buf) - dev_path_length,
kCFStringEncodingASCII ) )
{
[p_list addObject: [NSString stringWithCString: psz_buf]];
[p_list addObject: [NSString stringWithUTF8String: psz_buf]];
}
CFRelease( str_bsd_path );
......@@ -291,12 +291,10 @@ static VLCOpen *_o_sharedMainInstance = nil;
i_index++ )
{
[o_file_sub_encoding_pop addItemWithTitle:
[NSString stringWithCString:
p_item->ppsz_list[i_index]]];
[NSString stringWithUTF8String: p_item->ppsz_list[i_index]]];
}
[o_file_sub_encoding_pop selectItemWithTitle:
[NSString stringWithCString:
p_item->value.psz]];
[NSString stringWithUTF8String: p_item->value.psz]];
}
p_item = config_FindConfig( VLC_OBJECT(p_intf), "subsdec-align" );
......
......@@ -275,8 +275,6 @@
if( !EMPTY_STR( psz_title ) )
{
o_value = [NSString stringWithUTF8String: psz_title];
if( o_value == NULL )
o_value = [NSString stringWithCString: psz_title];
}
else
{
......@@ -284,8 +282,6 @@
if( psz_name != NULL )
{
o_value = [NSString stringWithUTF8String: psz_name];
if( o_value == NULL )
o_value = [NSString stringWithCString: psz_name];
}
free( psz_name );
}
......@@ -297,8 +293,6 @@
if( [[o_tc identifier] isEqualToString:@"2"] && !EMPTY_STR( psz_artist ) )
{
o_value = [NSString stringWithUTF8String: psz_artist];
if( o_value == NULL )
o_value = [NSString stringWithCString: psz_artist];
}
else if( [[o_tc identifier] isEqualToString:@"3"] )
{
......@@ -410,7 +404,7 @@
action: @selector(servicesChange:)
keyEquivalent: @""];
[o_lmi setTarget: self];
[o_lmi setRepresentedObject: [NSString stringWithCString: ppsz_services[i]]];
[o_lmi setRepresentedObject: [NSString stringWithUTF8String: ppsz_services[i]]];
if( b_enabled ) [o_lmi setState: NSOnState];
/* Create the menu entries for the main menu */
......@@ -419,7 +413,7 @@
action: @selector(servicesChange:)
keyEquivalent: @""];
[o_lmi setTarget: self];
[o_lmi setRepresentedObject: [NSString stringWithCString: ppsz_services[i]]];
[o_lmi setRepresentedObject: [NSString stringWithUTF8String: ppsz_services[i]]];
if( b_enabled ) [o_lmi setState: NSOnState];
free( ppsz_services[i] );
......@@ -953,14 +947,14 @@
{
NSMutableString *o_temp, *o_temp2;
o_temp = [NSMutableString stringWithString: o_uri];
o_temp2 = [NSMutableString stringWithCString: mounts[i_index].f_mntfromname];
o_temp2 = [NSMutableString stringWithUTF8String: mounts[i_index].f_mntfromname];
[o_temp replaceOccurrencesOfString: @"/dev/rdisk" withString: @"/dev/disk" options:nil range:NSMakeRange(0, [o_temp length]) ];
[o_temp2 replaceOccurrencesOfString: @"s0" withString: @"" options:nil range:NSMakeRange(0, [o_temp2 length]) ];
[o_temp2 replaceOccurrencesOfString: @"s1" withString: @"" options:nil range:NSMakeRange(0, [o_temp2 length]) ];
if( strstr( [o_temp fileSystemRepresentation], [o_temp2 fileSystemRepresentation] ) != NULL )
{
o_name = [[NSFileManager defaultManager] displayNameAtPath: [NSString stringWithCString:mounts[i_index].f_mntonname]];
o_name = [[NSFileManager defaultManager] displayNameAtPath: [NSString stringWithUTF8String:mounts[i_index].f_mntonname]];
}
}
}
......@@ -980,7 +974,7 @@
buf = (struct statfs *) malloc (sizeof(struct statfs));
statfs( [o_uri fileSystemRepresentation], buf );
psz_dev = strdup(buf->f_mntfromname);
o_temp = [NSMutableString stringWithCString: psz_dev ];
o_temp = [NSMutableString stringWithUTF8String: psz_dev ];
[o_temp replaceOccurrencesOfString: @"/dev/disk" withString: @"/dev/rdisk" options:nil range:NSMakeRange(0, [o_temp length]) ];
[o_temp replaceOccurrencesOfString: @"s0" withString: @"" options:nil range:NSMakeRange(0, [o_temp length]) ];
[o_temp replaceOccurrencesOfString: @"s1" withString: @"" options:nil range:NSMakeRange(0, [o_temp length]) ];
......
......@@ -182,10 +182,7 @@
char *psz_uri = input_item_GetURI( p_item->p_input );
if( psz_uri )
{
[o_uri_txt setStringValue:
([NSString stringWithUTF8String:psz_uri] == nil ) ?
[NSString stringWithCString:psz_uri] :
[NSString stringWithUTF8String:psz_uri]];
[o_uri_txt setStringValue: [NSString stringWithUTF8String:psz_uri]];
}
free( psz_uri );
......@@ -220,10 +217,7 @@
- (void)setMeta: (char *)psz_meta forLabel: (id)theItem
{
if( psz_meta != NULL && *psz_meta)
[theItem setStringValue:
([NSString stringWithUTF8String:psz_meta] == nil ) ?
[NSString stringWithCString:psz_meta] :
[NSString stringWithUTF8String:psz_meta]];
[theItem setStringValue: [NSString stringWithUTF8String:psz_meta]];
else
[theItem setStringValue: @"-"];
}
......
......@@ -1986,7 +1986,7 @@
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 )
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]];
......@@ -2141,7 +2141,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];
......@@ -2151,7 +2151,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];
......@@ -2311,11 +2311,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;
......
......@@ -321,7 +321,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
}
else
{
[o_window setTitle: [NSString stringWithCString: VOUT_TITLE]];
[o_window setTitle: [NSString stringWithUTF8String: VOUT_TITLE]];
}
vlc_object_release( p_input );
}
......
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