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

macosx: use modern ObjC syntax for C-String to NSString conversations

parent 70337297
...@@ -77,8 +77,8 @@ static VLCAudioEffects *_o_sharedInstance = nil; ...@@ -77,8 +77,8 @@ static VLCAudioEffects *_o_sharedInstance = nil;
eqz_preset_10b[i].f_amp[9]]; eqz_preset_10b[i].f_amp[9]];
[workValues addObject:workString]; [workValues addObject:workString];
[workPreamp addObject:[NSString stringWithFormat:@"%1.f", eqz_preset_10b[i].f_preamp]]; [workPreamp addObject:[NSString stringWithFormat:@"%1.f", eqz_preset_10b[i].f_preamp]];
[workTitles addObject:[NSString stringWithUTF8String:preset_list_text[i]]]; [workTitles addObject:@(preset_list_text[i])];
[workNames addObject:[NSString stringWithUTF8String:preset_list[i]]]; [workNames addObject:@(preset_list[i])];
} }
NSString *defaultProfile = [NSString stringWithFormat:@"ZmxhdA==;;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%i", NSString *defaultProfile = [NSString stringWithFormat:@"ZmxhdA==;;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%i",
...@@ -178,9 +178,9 @@ static VLCAudioEffects *_o_sharedInstance = nil; ...@@ -178,9 +178,9 @@ static VLCAudioEffects *_o_sharedInstance = nil;
} }
} else { } else {
if (psz_tmp) { if (psz_tmp) {
psz_tmp = (char *)[[[NSString stringWithUTF8String: psz_tmp] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@":%s",psz_name]]] UTF8String]; psz_tmp = (char *)[[@(psz_tmp) stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@":%s",psz_name]]] UTF8String];
psz_tmp = (char *)[[[NSString stringWithUTF8String: psz_tmp] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@"%s:",psz_name]]] UTF8String]; psz_tmp = (char *)[[@(psz_tmp) stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@"%s:",psz_name]]] UTF8String];
psz_tmp = (char *)[[[NSString stringWithUTF8String: psz_tmp] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithUTF8String:psz_name]]] UTF8String]; psz_tmp = (char *)[[@(psz_tmp) stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:@(psz_name)]] UTF8String];
config_PutPsz(p_intf, "audio-filter", psz_tmp); config_PutPsz(p_intf, "audio-filter", psz_tmp);
} }
} }
......
...@@ -320,7 +320,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -320,7 +320,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[openPanel beginSheetModalForWindow:_window completionHandler:^(NSInteger returnCode) { [openPanel beginSheetModalForWindow:_window completionHandler:^(NSInteger returnCode) {
if (returnCode == NSOKButton) if (returnCode == NSOKButton)
{ {
[self setMRL: [NSString stringWithUTF8String:vlc_path2uri([[[openPanel URL] path] UTF8String], NULL)]]; [self setMRL: @(vlc_path2uri([[[openPanel URL] path] UTF8String], NULL))];
[self updateOKButton]; [self updateOKButton];
[self updateDropView]; [self updateDropView];
} }
...@@ -543,7 +543,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -543,7 +543,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
NSArray *values = [[paste propertyListForType: NSFilenamesPboardType] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; NSArray *values = [[paste propertyListForType: NSFilenamesPboardType] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
if ([values count] > 0) { if ([values count] > 0) {
[self setMRL: [NSString stringWithUTF8String:vlc_path2uri([[values objectAtIndex:0] UTF8String], NULL)]]; [self setMRL: @(vlc_path2uri([[values objectAtIndex:0] UTF8String], NULL))];
[self updateOKButton]; [self updateOKButton];
[self updateDropView]; [self updateDropView];
return YES; return YES;
......
...@@ -233,7 +233,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil; ...@@ -233,7 +233,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
} }
NSURL *o_url; NSURL *o_url;
o_url = [NSURL URLWithString:[NSString stringWithUTF8String:psz_uri]]; o_url = [NSURL URLWithString:@(psz_uri)];
vlc_object_release(p_input); vlc_object_release(p_input);
return o_url; return o_url;
...@@ -265,10 +265,10 @@ static VLCCoreInteraction *_o_sharedInstance = nil; ...@@ -265,10 +265,10 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
char *format = var_InheritString(VLCIntf, "input-title-format"); char *format = var_InheritString(VLCIntf, "input-title-format");
char *formated = str_format_meta(pl_Get(VLCIntf), format); char *formated = str_format_meta(pl_Get(VLCIntf), format);
free(format); free(format);
o_name = [NSString stringWithUTF8String:formated]; o_name = @(formated);
free(formated); free(formated);
NSURL * o_url = [NSURL URLWithString: [NSString stringWithUTF8String: psz_uri]]; NSURL * o_url = [NSURL URLWithString: @(psz_uri)];
free(psz_uri); free(psz_uri);
if ([o_name isEqualToString:@""]) { if ([o_name isEqualToString:@""]) {
......
...@@ -142,7 +142,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -142,7 +142,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
// Get the web view // Get the web view
assert([control isKindOfClass:[WebView class]]); assert([control isKindOfClass:[WebView class]]);
WebView *webView = (WebView *)control; WebView *webView = (WebView *)control;
NSString *string = [NSString stringWithUTF8String:widget->psz_text]; NSString *string = @(widget->psz_text);
[[webView mainFrame] loadHTMLString:string baseURL:[NSURL URLWithString:@""]]; [[webView mainFrame] loadHTMLString:string baseURL:[NSURL URLWithString:@""]];
[webView setNeedsDisplay:YES]; [webView setNeedsDisplay:YES];
break; break;
...@@ -151,7 +151,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -151,7 +151,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
{ {
assert([control isKindOfClass:[NSTextView class]]); assert([control isKindOfClass:[NSTextView class]]);
NSTextView *textView = (NSTextView *)control; NSTextView *textView = (NSTextView *)control;
NSString *string = [NSString stringWithUTF8String:widget->psz_text]; NSString *string = @(widget->psz_text);
NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding: NSISOLatin1StringEncoding] documentAttributes:NULL]; NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding: NSISOLatin1StringEncoding] documentAttributes:NULL];
[[textView textStorage] setAttributedString:attrString]; [[textView textStorage] setAttributedString:attrString];
[textView setNeedsDisplay:YES]; [textView setNeedsDisplay:YES];
...@@ -181,7 +181,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -181,7 +181,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
NSButton *button = (NSButton *)control; NSButton *button = (NSButton *)control;
if (!widget->psz_text) if (!widget->psz_text)
break; break;
[button setTitle:[NSString stringWithUTF8String:widget->psz_text]]; [button setTitle:@(widget->psz_text)];
break; break;
} }
case EXTENSION_WIDGET_DROPDOWN: case EXTENSION_WIDGET_DROPDOWN:
...@@ -191,9 +191,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -191,9 +191,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
[popup removeAllItems]; [popup removeAllItems];
struct extension_widget_value_t *value; struct extension_widget_value_t *value;
for (value = widget->p_values; value != NULL; value = value->p_next) for (value = widget->p_values; value != NULL; value = value->p_next)
{ [popup addItemWithTitle:@(value->psz_text)];
[popup addItemWithTitle:[NSString stringWithUTF8String:value->psz_text]];
}
[popup synchronizeTitleAndSelectedItem]; [popup synchronizeTitleAndSelectedItem];
[self popUpSelectionChanged:popup]; [self popUpSelectionChanged:popup];
break; break;
...@@ -211,7 +209,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -211,7 +209,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
{ {
NSDictionary *entry = [NSDictionary dictionaryWithObjectsAndKeys: NSDictionary *entry = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:value->i_id], @"id", [NSNumber numberWithInt:value->i_id], @"id",
[NSString stringWithUTF8String:value->psz_text], @"text", @(value->psz_text), @"text",
nil]; nil];
[contentArray addObject:entry]; [contentArray addObject:entry];
} }
...@@ -223,7 +221,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -223,7 +221,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
{ {
assert([control isKindOfClass:[NSImageView class]]); assert([control isKindOfClass:[NSImageView class]]);
NSImageView *imageView = (NSImageView *)control; NSImageView *imageView = (NSImageView *)control;
NSString *string = widget->psz_text ? [NSString stringWithUTF8String:widget->psz_text] : nil; NSString *string = widget->psz_text ? @(widget->psz_text) : nil;
NSImage *image = nil; NSImage *image = nil;
if (string) if (string)
image = [[NSImage alloc] initWithContentsOfURL:[NSURL fileURLWithPath:string]]; image = [[NSImage alloc] initWithContentsOfURL:[NSURL fileURLWithPath:string]];
...@@ -311,7 +309,7 @@ static ExtensionsDialogProvider *_o_sharedInstance = nil; ...@@ -311,7 +309,7 @@ static ExtensionsDialogProvider *_o_sharedInstance = nil;
- (void)performEventWithObject: (NSValue *)o_value ofType: (const char*)type - (void)performEventWithObject: (NSValue *)o_value ofType: (const char*)type
{ {
NSString *o_type = [NSString stringWithUTF8String:type]; NSString *o_type = @(type);
if ([o_type isEqualToString: @"dialog-extension"]) { if ([o_type isEqualToString: @"dialog-extension"]) {
[self performSelectorOnMainThread:@selector(updateExtensionDialog:) [self performSelectorOnMainThread:@selector(updateExtensionDialog:)
...@@ -459,7 +457,7 @@ static ExtensionsDialogProvider *_o_sharedInstance = nil; ...@@ -459,7 +457,7 @@ static ExtensionsDialogProvider *_o_sharedInstance = nil;
defer:NO]; defer:NO];
[dialogWindow setDelegate:self]; [dialogWindow setDelegate:self];
[dialogWindow setDialog:p_dialog]; [dialogWindow setDialog:p_dialog];
[dialogWindow setTitle:[NSString stringWithUTF8String:p_dialog->psz_title]]; [dialogWindow setTitle:@(p_dialog->psz_title)];
VLCDialogGridView *gridView = [[VLCDialogGridView alloc] init]; VLCDialogGridView *gridView = [[VLCDialogGridView alloc] init];
[gridView setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable]; [gridView setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
......
...@@ -289,7 +289,7 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -289,7 +289,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
[mi setTarget:self]; [mi setTarget:self];
[mi setAction:selector]; [mi setAction:selector];
[mi setTag:p_item->list.i[i]]; [mi setTag:p_item->list.i[i]];
[mi setRepresentedObject:[NSString stringWithUTF8String:psz_name]]; [mi setRepresentedObject:@(psz_name)];
[menu addItem: [mi autorelease]]; [menu addItem: [mi autorelease]];
if (p_item->value.i == p_item->list.i[i]) if (p_item->value.i == p_item->list.i[i])
[mi setState:NSOnState]; [mi setState:NSOnState];
...@@ -926,7 +926,7 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -926,7 +926,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
[openPanel setCanChooseDirectories: NO]; [openPanel setCanChooseDirectories: NO];
[openPanel setAllowsMultipleSelection: YES]; [openPanel setAllowsMultipleSelection: YES];
[openPanel setAllowedFileTypes: @[@"cdg",@"@idx",@"srt",@"sub",@"utf",@"ass",@"ssa",@"aqt",@"jss",@"psb",@"rt",@"smi",@"txt",@"smil"]]; [openPanel setAllowedFileTypes: @[@"cdg",@"@idx",@"srt",@"sub",@"utf",@"ass",@"ssa",@"aqt",@"jss",@"psb",@"rt",@"smi",@"txt",@"smil"]];
[openPanel setDirectoryURL:[NSURL fileURLWithPath:[[NSString stringWithUTF8String:path] stringByExpandingTildeInPath]]]; [openPanel setDirectoryURL:[NSURL fileURLWithPath:[@(path) stringByExpandingTildeInPath]]];
i_returnValue = [openPanel runModal]; i_returnValue = [openPanel runModal];
free(path); free(path);
......
...@@ -249,19 +249,19 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -249,19 +249,19 @@ static VLCMainWindow *_o_sharedInstance = nil;
else else
[[internetItems lastObject] setIcon: [NSImage imageNamed:@"NSApplicationIcon"]]; [[internetItems lastObject] setIcon: [NSImage imageNamed:@"NSApplicationIcon"]];
[[internetItems lastObject] setSdtype: SD_CAT_INTERNET]; [[internetItems lastObject] setSdtype: SD_CAT_INTERNET];
[[internetItems lastObject] setUntranslatedTitle: [NSString stringWithUTF8String: *ppsz_longname]]; [[internetItems lastObject] setUntranslatedTitle: @(*ppsz_longname)];
break; break;
case SD_CAT_DEVICES: case SD_CAT_DEVICES:
[devicesItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]]; [devicesItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]];
[[devicesItems lastObject] setIcon: [NSImage imageNamed:@"NSApplicationIcon"]]; [[devicesItems lastObject] setIcon: [NSImage imageNamed:@"NSApplicationIcon"]];
[[devicesItems lastObject] setSdtype: SD_CAT_DEVICES]; [[devicesItems lastObject] setSdtype: SD_CAT_DEVICES];
[[devicesItems lastObject] setUntranslatedTitle: [NSString stringWithUTF8String: *ppsz_longname]]; [[devicesItems lastObject] setUntranslatedTitle: @(*ppsz_longname)];
break; break;
case SD_CAT_LAN: case SD_CAT_LAN:
[lanItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]]; [lanItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]];
[[lanItems lastObject] setIcon: [NSImage imageNamed:@"sidebar-local"]]; [[lanItems lastObject] setIcon: [NSImage imageNamed:@"sidebar-local"]];
[[lanItems lastObject] setSdtype: SD_CAT_LAN]; [[lanItems lastObject] setSdtype: SD_CAT_LAN];
[[lanItems lastObject] setUntranslatedTitle: [NSString stringWithUTF8String: *ppsz_longname]]; [[lanItems lastObject] setUntranslatedTitle: @(*ppsz_longname)];
break; break;
case SD_CAT_MYCOMPUTER: case SD_CAT_MYCOMPUTER:
[mycompItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]]; [mycompItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]];
...@@ -273,7 +273,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -273,7 +273,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[[mycompItems lastObject] setIcon: [NSImage imageNamed:@"sidebar-pictures"]]; [[mycompItems lastObject] setIcon: [NSImage imageNamed:@"sidebar-pictures"]];
else else
[[mycompItems lastObject] setIcon: [NSImage imageNamed:@"NSApplicationIcon"]]; [[mycompItems lastObject] setIcon: [NSImage imageNamed:@"NSApplicationIcon"]];
[[mycompItems lastObject] setUntranslatedTitle: [NSString stringWithUTF8String: *ppsz_longname]]; [[mycompItems lastObject] setUntranslatedTitle: @(*ppsz_longname)];
[[mycompItems lastObject] setSdtype: SD_CAT_MYCOMPUTER]; [[mycompItems lastObject] setSdtype: SD_CAT_MYCOMPUTER];
break; break;
default: default:
...@@ -635,14 +635,14 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -635,14 +635,14 @@ static VLCMainWindow *_o_sharedInstance = nil;
char *format = var_InheritString(VLCIntf, "input-title-format"); char *format = var_InheritString(VLCIntf, "input-title-format");
char *formated = str_format_meta(pl_Get(VLCIntf), format); char *formated = str_format_meta(pl_Get(VLCIntf), format);
free(format); free(format);
aString = [NSString stringWithUTF8String:formated]; aString = @(formated);
free(formated); free(formated);
} else } else
aString = [NSString stringWithUTF8String:config_GetPsz(VLCIntf, "video-title")]; aString = @(config_GetPsz(VLCIntf, "video-title"));
char *uri = input_item_GetURI(input_GetItem(p_input)); char *uri = input_item_GetURI(input_GetItem(p_input));
NSURL * o_url = [NSURL URLWithString: [NSString stringWithUTF8String: uri]]; NSURL * o_url = [NSURL URLWithString: @(uri)];
if ([o_url isFileURL]) { if ([o_url isFileURL]) {
[self setRepresentedURL: o_url]; [self setRepresentedURL: o_url];
[[[VLCMain sharedInstance] voutController] updateWindowsUsingBlock:^(VLCVideoWindowCommon *o_window) { [[[VLCMain sharedInstance] voutController] updateWindowsUsingBlock:^(VLCVideoWindowCommon *o_window) {
...@@ -1189,7 +1189,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1189,7 +1189,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
{ {
if (config_GetPsz(VLCIntf, "podcast-urls") != NULL) { if (config_GetPsz(VLCIntf, "podcast-urls") != NULL) {
[o_podcast_unsubscribe_pop removeAllItems]; [o_podcast_unsubscribe_pop removeAllItems];
[o_podcast_unsubscribe_pop addItemsWithTitles:[[NSString stringWithUTF8String:config_GetPsz(VLCIntf, "podcast-urls")] componentsSeparatedByString:@"|"]]; [o_podcast_unsubscribe_pop addItemsWithTitles:[@(config_GetPsz(VLCIntf, "podcast-urls")) componentsSeparatedByString:@"|"]];
[NSApp beginSheet:o_podcast_unsubscribe_window modalForWindow:self modalDelegate:self didEndSelector:NULL contextInfo:nil]; [NSApp beginSheet:o_podcast_unsubscribe_window modalForWindow:self modalDelegate:self didEndSelector:NULL contextInfo:nil];
} }
} }
...@@ -1200,7 +1200,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1200,7 +1200,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[NSApp endSheet: o_podcast_unsubscribe_window]; [NSApp endSheet: o_podcast_unsubscribe_window];
if (sender == o_podcast_unsubscribe_ok_btn) { if (sender == o_podcast_unsubscribe_ok_btn) {
NSMutableArray * urls = [[NSMutableArray alloc] initWithArray:[[NSString stringWithUTF8String:config_GetPsz(VLCIntf, "podcast-urls")] componentsSeparatedByString:@"|"]]; NSMutableArray * urls = [[NSMutableArray alloc] initWithArray:[@(config_GetPsz(VLCIntf, "podcast-urls")) componentsSeparatedByString:@"|"]];
[urls removeObjectAtIndex: [o_podcast_unsubscribe_pop indexOfSelectedItem]]; [urls removeObjectAtIndex: [o_podcast_unsubscribe_pop indexOfSelectedItem]];
config_PutPsz(VLCIntf, "podcast-urls", [[urls componentsJoinedByString:@"|"] UTF8String]); config_PutPsz(VLCIntf, "podcast-urls", [[urls componentsJoinedByString:@"|"] UTF8String]);
var_SetString(pl_Get(VLCIntf), "podcast-urls", config_GetPsz(VLCIntf, "podcast-urls")); var_SetString(pl_Get(VLCIntf), "podcast-urls", config_GetPsz(VLCIntf, "podcast-urls"));
......
...@@ -130,18 +130,18 @@ static VLCStringUtility *_o_sharedInstance = nil; ...@@ -130,18 +130,18 @@ static VLCStringUtility *_o_sharedInstance = nil;
theString = [NSString stringWithFormat:@"%@-", theString]; theString = [NSString stringWithFormat:@"%@-", theString];
} }
/* modifiers */ /* modifiers */
theString = [theString stringByReplacingOccurrencesOfString:@"Command" withString: [NSString stringWithUTF8String: "\xE2\x8C\x98"]]; theString = [theString stringByReplacingOccurrencesOfString:@"Command" withString: @("\xE2\x8C\x98")];
theString = [theString stringByReplacingOccurrencesOfString:@"Alt" withString: [NSString stringWithUTF8String: "\xE2\x8C\xA5"]]; theString = [theString stringByReplacingOccurrencesOfString:@"Alt" withString: @("\xE2\x8C\xA5")];
theString = [theString stringByReplacingOccurrencesOfString:@"Shift" withString: [NSString stringWithUTF8String: "\xE2\x87\xA7"]]; theString = [theString stringByReplacingOccurrencesOfString:@"Shift" withString: @("\xE2\x87\xA7")];
theString = [theString stringByReplacingOccurrencesOfString:@"Ctrl" withString: [NSString stringWithUTF8String: "\xE2\x8C\x83"]]; theString = [theString stringByReplacingOccurrencesOfString:@"Ctrl" withString: @("\xE2\x8C\x83")];
/* show non-character keys correctly */ /* show non-character keys correctly */
theString = [theString stringByReplacingOccurrencesOfString:@"Right" withString:[NSString stringWithUTF8String:"\xE2\x86\x92"]]; theString = [theString stringByReplacingOccurrencesOfString:@"Right" withString:@("\xE2\x86\x92")];
theString = [theString stringByReplacingOccurrencesOfString:@"Left" withString:[NSString stringWithUTF8String:"\xE2\x86\x90"]]; theString = [theString stringByReplacingOccurrencesOfString:@"Left" withString:@("\xE2\x86\x90")];
theString = [theString stringByReplacingOccurrencesOfString:@"Up" withString:[NSString stringWithUTF8String:"\xE2\x86\x91"]]; theString = [theString stringByReplacingOccurrencesOfString:@"Up" withString:@("\xE2\x86\x91")];
theString = [theString stringByReplacingOccurrencesOfString:@"Down" withString:[NSString stringWithUTF8String:"\xE2\x86\x93"]]; theString = [theString stringByReplacingOccurrencesOfString:@"Down" withString:@("\xE2\x86\x93")];
theString = [theString stringByReplacingOccurrencesOfString:@"Enter" withString:[NSString stringWithUTF8String:"\xe2\x86\xb5"]]; theString = [theString stringByReplacingOccurrencesOfString:@"Enter" withString:@("\xe2\x86\xb5")];
theString = [theString stringByReplacingOccurrencesOfString:@"Tab" withString:[NSString stringWithUTF8String:"\xe2\x87\xa5"]]; theString = [theString stringByReplacingOccurrencesOfString:@"Tab" withString:@("\xe2\x87\xa5")];
theString = [theString stringByReplacingOccurrencesOfString:@"Delete" withString:[NSString stringWithUTF8String:"\xe2\x8c\xab"]]; /* capitalize plain characters to suit the menubar's look */ theString = [theString stringByReplacingOccurrencesOfString:@"Delete" withString:@("\xe2\x8c\xab")]; /* capitalize plain characters to suit the menubar's look */
theString = [theString capitalizedString]; theString = [theString capitalizedString];
} }
else else
...@@ -165,7 +165,7 @@ static VLCStringUtility *_o_sharedInstance = nil; ...@@ -165,7 +165,7 @@ static VLCStringUtility *_o_sharedInstance = nil;
remaining = dur - time.i_time; remaining = dur - time.i_time;
return [NSString stringWithFormat: @"-%s", secstotimestr(psz_time, (remaining / 1000000))]; return [NSString stringWithFormat: @"-%s", secstotimestr(psz_time, (remaining / 1000000))];
} else } else
return [NSString stringWithUTF8String: secstotimestr(psz_time, (time.i_time / 1000000))]; return @(secstotimestr(psz_time, (time.i_time / 1000000)));
} }
#pragma mark - #pragma mark -
......
...@@ -366,7 +366,7 @@ static VLCVideoEffects *_o_sharedInstance = nil; ...@@ -366,7 +366,7 @@ static VLCVideoEffects *_o_sharedInstance = nil;
[o_crop_sync_left_right_ckb setState: NSOffState]; [o_crop_sync_left_right_ckb setState: NSOffState];
tmpChar = config_GetPsz(p_intf, "transform-type"); tmpChar = config_GetPsz(p_intf, "transform-type");
tmpString = [NSString stringWithUTF8String: tmpChar]; tmpString = @(tmpChar);
if ([tmpString isEqualToString:@"hflip"]) if ([tmpString isEqualToString:@"hflip"])
[o_transform_pop selectItemWithTag: 1]; [o_transform_pop selectItemWithTag: 1];
else if ([tmpString isEqualToString:@"vflip"]) else if ([tmpString isEqualToString:@"vflip"])
...@@ -425,7 +425,7 @@ static VLCVideoEffects *_o_sharedInstance = nil; ...@@ -425,7 +425,7 @@ static VLCVideoEffects *_o_sharedInstance = nil;
[o_sepia_lbl setEnabled: b_state]; [o_sepia_lbl setEnabled: b_state];
tmpChar = config_GetPsz(p_intf, "gradient-mode"); tmpChar = config_GetPsz(p_intf, "gradient-mode");
tmpString = [NSString stringWithUTF8String: tmpChar]; tmpString = @(tmpChar);
if ([tmpString isEqualToString:@"hough"]) if ([tmpString isEqualToString:@"hough"])
[o_gradient_mode_pop selectItemWithTag: 3]; [o_gradient_mode_pop selectItemWithTag: 3];
else if ([tmpString isEqualToString:@"edge"]) else if ([tmpString isEqualToString:@"edge"])
...@@ -458,7 +458,7 @@ static VLCVideoEffects *_o_sharedInstance = nil; ...@@ -458,7 +458,7 @@ static VLCVideoEffects *_o_sharedInstance = nil;
tmpChar = config_GetPsz(p_intf, "marq-marquee"); tmpChar = config_GetPsz(p_intf, "marq-marquee");
if (tmpChar) { if (tmpChar) {
[o_addtext_text_fld setStringValue: [NSString stringWithUTF8String: tmpChar]]; [o_addtext_text_fld setStringValue: @(tmpChar)];
FREENULL(tmpChar); FREENULL(tmpChar);
} else } else
[o_addtext_text_fld setStringValue: @""]; [o_addtext_text_fld setStringValue: @""];
...@@ -471,7 +471,7 @@ static VLCVideoEffects *_o_sharedInstance = nil; ...@@ -471,7 +471,7 @@ static VLCVideoEffects *_o_sharedInstance = nil;
tmpChar = config_GetPsz(p_intf, "logo-file"); tmpChar = config_GetPsz(p_intf, "logo-file");
if (tmpChar) { if (tmpChar) {
[o_addlogo_logo_fld setStringValue: [NSString stringWithUTF8String: tmpChar]]; [o_addlogo_logo_fld setStringValue: @(tmpChar)];
FREENULL(tmpChar); FREENULL(tmpChar);
} else } else
[o_addlogo_logo_fld setStringValue: @""]; [o_addlogo_logo_fld setStringValue: @""];
......
...@@ -117,7 +117,7 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -117,7 +117,7 @@ static VLAboutBox *_o_sharedInstance = nil;
/* Setup the nameversion field */ /* Setup the nameversion field */
[o_name_version_field setStringValue: [NSString stringWithFormat:@"Version %s (%s)", VERSION_MESSAGE, PLATFORM]]; [o_name_version_field setStringValue: [NSString stringWithFormat:@"Version %s (%s)", VERSION_MESSAGE, PLATFORM]];
NSMutableArray *tmpArray = [NSMutableArray arrayWithArray: [[NSString stringWithUTF8String: psz_authors]componentsSeparatedByString:@"\n\n"]]; NSMutableArray *tmpArray = [NSMutableArray arrayWithArray: [@(psz_authors) componentsSeparatedByString:@"\n\n"]];
NSUInteger count = [tmpArray count]; NSUInteger count = [tmpArray count];
for (NSUInteger i = 0; i < count; i++) { for (NSUInteger i = 0; i < count; i++) {
[tmpArray replaceObjectAtIndex:i withObject:[[tmpArray objectAtIndex:i]stringByReplacingOccurrencesOfString:@"\n" withString:@", "]]; [tmpArray replaceObjectAtIndex:i withObject:[[tmpArray objectAtIndex:i]stringByReplacingOccurrencesOfString:@"\n" withString:@", "]];
...@@ -236,9 +236,9 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -236,9 +236,9 @@ static VLAboutBox *_o_sharedInstance = nil;
if (sender == o_authors_btn) if (sender == o_authors_btn)
[o_credits_textview setString:o_authors]; [o_credits_textview setString:o_authors];
else if (sender == o_credits_btn) else if (sender == o_credits_btn)
[o_credits_textview setString:[[NSString stringWithUTF8String: psz_thanks] stringByReplacingOccurrencesOfString:@"\n" withString:@" " options:0 range:NSRangeFromString(@"680 2")]]; [o_credits_textview setString:[@(psz_thanks) stringByReplacingOccurrencesOfString:@"\n" withString:@" " options:0 range:NSRangeFromString(@"680 2")]];
else else
[o_credits_textview setString:[NSString stringWithUTF8String: psz_license]]; [o_credits_textview setString:@(psz_license)];
[o_credits_textview scrollPoint:NSMakePoint(0, 0)]; [o_credits_textview scrollPoint:NSMakePoint(0, 0)];
b_restart = YES; b_restart = YES;
...@@ -255,7 +255,7 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -255,7 +255,7 @@ static VLAboutBox *_o_sharedInstance = nil;
[o_credits_textview setHidden:NO]; [o_credits_textview setHidden:NO];
[o_joinus_txt setHidden:YES]; [o_joinus_txt setHidden:YES];
[o_credits_textview setString:[NSString stringWithUTF8String: psz_license]]; [o_credits_textview setString:@(psz_license)];
[o_credits_textview scrollPoint:NSMakePoint(0, 0)]; [o_credits_textview scrollPoint:NSMakePoint(0, 0)];
b_restart = YES; b_restart = YES;
......
...@@ -67,7 +67,7 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil; ...@@ -67,7 +67,7 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
-(void)performEventWithObject: (NSValue *)o_value ofType: (const char*)type -(void)performEventWithObject: (NSValue *)o_value ofType: (const char*)type
{ {
NSString *o_type = [NSString stringWithUTF8String:type]; NSString *o_type = @(type);
if ([o_type isEqualToString: @"dialog-error"]) if ([o_type isEqualToString: @"dialog-error"])
[self performSelectorOnMainThread:@selector(showFatalDialog:) withObject:o_value waitUntilDone:YES]; [self performSelectorOnMainThread:@selector(showFatalDialog:) withObject:o_value waitUntilDone:YES];
...@@ -87,7 +87,7 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil; ...@@ -87,7 +87,7 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
{ {
dialog_fatal_t *p_dialog = [o_value pointerValue]; dialog_fatal_t *p_dialog = [o_value pointerValue];
[o_error_panel addError: [NSString stringWithUTF8String: p_dialog->title] withMsg: [NSString stringWithUTF8String: p_dialog->message]]; [o_error_panel addError: @(p_dialog->title) withMsg: @(p_dialog->message)];
[o_error_panel showPanel]; [o_error_panel showPanel];
} }
...@@ -96,7 +96,7 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil; ...@@ -96,7 +96,7 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
dialog_fatal_t *p_dialog = [o_value pointerValue]; dialog_fatal_t *p_dialog = [o_value pointerValue];
NSAlert *o_alert; NSAlert *o_alert;
o_alert = [NSAlert alertWithMessageText: [NSString stringWithUTF8String: p_dialog->title] defaultButton: _NS("OK") alternateButton: nil otherButton: nil informativeTextWithFormat: @"%s", p_dialog->message]; o_alert = [NSAlert alertWithMessageText: @(p_dialog->title) defaultButton: _NS("OK") alternateButton: nil otherButton: nil informativeTextWithFormat: @"%s", p_dialog->message];
[o_alert setAlertStyle: NSCriticalAlertStyle]; [o_alert setAlertStyle: NSCriticalAlertStyle];
[o_alert runModal]; [o_alert runModal];
} }
...@@ -109,13 +109,13 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil; ...@@ -109,13 +109,13 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
NSInteger i_returnValue = 0; NSInteger i_returnValue = 0;
if (p_dialog->yes != NULL) if (p_dialog->yes != NULL)
o_yes = [NSString stringWithUTF8String: p_dialog->yes]; o_yes = @(p_dialog->yes);
if (p_dialog->no != NULL) if (p_dialog->no != NULL)
o_no = [NSString stringWithUTF8String: p_dialog->no]; o_no = @(p_dialog->no);
if (p_dialog->cancel != NULL) if (p_dialog->cancel != NULL)
o_cancel = [NSString stringWithUTF8String: p_dialog->cancel]; o_cancel = @(p_dialog->cancel);
o_alert = [NSAlert alertWithMessageText: [NSString stringWithUTF8String: p_dialog->title] defaultButton: o_yes alternateButton:o_no otherButton: o_cancel informativeTextWithFormat: @"%s", p_dialog->message]; o_alert = [NSAlert alertWithMessageText: @(p_dialog->title) defaultButton: o_yes alternateButton:o_no otherButton: o_cancel informativeTextWithFormat: @"%s", p_dialog->message];
[o_alert setAlertStyle: NSInformationalAlertStyle]; [o_alert setAlertStyle: NSInformationalAlertStyle];
i_returnValue = [o_alert runModal]; i_returnValue = [o_alert runModal];
...@@ -132,9 +132,9 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil; ...@@ -132,9 +132,9 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
dialog_login_t *p_dialog = [o_value pointerValue]; dialog_login_t *p_dialog = [o_value pointerValue];
NSInteger i_returnValue = 0; NSInteger i_returnValue = 0;
[o_auth_title_txt setStringValue: [NSString stringWithUTF8String: p_dialog->title]]; [o_auth_title_txt setStringValue: @(p_dialog->title)];
[o_auth_win setTitle: [NSString stringWithUTF8String: p_dialog->title]]; [o_auth_win setTitle: @(p_dialog->title)];
[o_auth_description_txt setStringValue: [NSString stringWithUTF8String: p_dialog->message]]; [o_auth_description_txt setStringValue: @(p_dialog->message)];
[o_auth_login_fld setStringValue: @""]; [o_auth_login_fld setStringValue: @""];
[o_auth_pw_fld setStringValue: @""]; [o_auth_pw_fld setStringValue: @""];
...@@ -170,18 +170,18 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil; ...@@ -170,18 +170,18 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
if (p_dialog->title != NULL) if (p_dialog->title != NULL)
{ {
[o_prog_win setTitle: [NSString stringWithUTF8String: p_dialog->title]]; [o_prog_win setTitle: @(p_dialog->title)];
[o_prog_title_txt setStringValue: [NSString stringWithUTF8String: p_dialog->title]]; [o_prog_title_txt setStringValue: @(p_dialog->title)];
} else { } else {
[o_prog_win setTitle: @""]; [o_prog_win setTitle: @""];
[o_prog_title_txt setStringValue: @""]; [o_prog_title_txt setStringValue: @""];
} }
if (p_dialog->cancel != NULL) if (p_dialog->cancel != NULL)
[o_prog_cancel_btn setTitle: [NSString stringWithUTF8String: p_dialog->cancel]]; [o_prog_cancel_btn setTitle: @(p_dialog->cancel)];
else else
[o_prog_cancel_btn setTitle: _NS("Cancel")]; [o_prog_cancel_btn setTitle: _NS("Cancel")];
if (p_dialog->message != NULL) if (p_dialog->message != NULL)
[o_prog_description_txt setStringValue: [NSString stringWithUTF8String: p_dialog->message]]; [o_prog_description_txt setStringValue: @(p_dialog->message)];
else else
[o_prog_description_txt setStringValue: @""]; [o_prog_description_txt setStringValue: @""];
......
...@@ -551,13 +551,13 @@ ...@@ -551,13 +551,13 @@
remaining = dur - time.i_time; remaining = dur - time.i_time;
o_total_time = [NSString stringWithFormat: @"-%s", secstotimestr(psz_time, (remaining / 1000000))]; o_total_time = [NSString stringWithFormat: @"-%s", secstotimestr(psz_time, (remaining / 1000000))];
} else } else
o_total_time = [NSString stringWithUTF8String: secstotimestr(psz_time, (dur / 1000000))]; o_total_time = @(secstotimestr(psz_time, (dur / 1000000)));
[o_streamLength_txt setStringValue: o_total_time]; [o_streamLength_txt setStringValue: o_total_time];
} }
// update current position (left field) // update current position (left field)
NSString *o_playback_pos = [NSString stringWithUTF8String: secstotimestr(psz_time, (time.i_time / 1000000))]; NSString *o_playback_pos = @(secstotimestr(psz_time, (time.i_time / 1000000)));
[o_streamPosition_txt setStringValue: o_playback_pos]; [o_streamPosition_txt setStringValue: o_playback_pos];
vlc_object_release(p_input); vlc_object_release(p_input);
......
...@@ -496,7 +496,7 @@ static int DialogCallback(vlc_object_t *p_this, const char *type, vlc_value_t pr ...@@ -496,7 +496,7 @@ static int DialogCallback(vlc_object_t *p_this, const char *type, vlc_value_t pr
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
VLCMain *interface = (VLCMain *)data; VLCMain *interface = (VLCMain *)data;
if ([[NSString stringWithUTF8String: type] isEqualToString: @"dialog-progress-bar"]) { if ([@(type) isEqualToString: @"dialog-progress-bar"]) {
/* the progress panel needs to update itself and therefore wants special treatment within this context */ /* the progress panel needs to update itself and therefore wants special treatment within this context */
dialog_progress_bar_t *p_dialog = (dialog_progress_bar_t *)value.p_address; dialog_progress_bar_t *p_dialog = (dialog_progress_bar_t *)value.p_address;
...@@ -519,7 +519,7 @@ void updateProgressPanel (void *priv, const char *text, float value) ...@@ -519,7 +519,7 @@ void updateProgressPanel (void *priv, const char *text, float value)
NSString *o_txt; NSString *o_txt;
if (text != NULL) if (text != NULL)
o_txt = [NSString stringWithUTF8String: text]; o_txt = @(text);
else else
o_txt = @""; o_txt = @"";
...@@ -1271,7 +1271,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1271,7 +1271,7 @@ static VLCMain *_o_sharedMainInstance = nil;
&& !strncmp(p_item->psz_name , "key-", 4) && !strncmp(p_item->psz_name , "key-", 4)
&& !EMPTY_STR(p_item->psz_text)) { && !EMPTY_STR(p_item->psz_text)) {
if (p_item->value.psz) if (p_item->value.psz)
[o_tempArray addObject: [NSString stringWithUTF8String:p_item->value.psz]]; [o_tempArray addObject: @(p_item->value.psz)];
} }
} }
module_config_free (p_config); module_config_free (p_config);
......
...@@ -850,7 +850,7 @@ static VLCOpen *_o_sharedMainInstance = nil; ...@@ -850,7 +850,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
GetVolParmsInfoBuffer volumeParms; GetVolParmsInfoBuffer volumeParms;
err = FSGetVolumeParms(actualVolume, &volumeParms, sizeof(volumeParms)); err = FSGetVolumeParms(actualVolume, &volumeParms, sizeof(volumeParms));
if (noErr == err) { if (noErr == err) {
NSString *bsdName = [NSString stringWithUTF8String:(char *)volumeParms.vMDeviceID]; NSString *bsdName = @((char *)volumeParms.vMDeviceID);
return [NSString stringWithFormat:@"/dev/r%@", bsdName]; return [NSString stringWithFormat:@"/dev/r%@", bsdName];
} }
......
...@@ -295,20 +295,20 @@ ...@@ -295,20 +295,20 @@
if ([o_identifier isEqualToString:TRACKNUM_COLUMN]) { if ([o_identifier isEqualToString:TRACKNUM_COLUMN]) {
psz_value = input_item_GetTrackNumber(p_item->p_input); psz_value = input_item_GetTrackNumber(p_item->p_input);
if (psz_value) { if (psz_value) {
o_value = [NSString stringWithUTF8String: psz_value]; o_value = @(psz_value);
free(psz_value); free(psz_value);
} }
} else if ([o_identifier isEqualToString:TITLE_COLUMN]) { } else if ([o_identifier isEqualToString:TITLE_COLUMN]) {
/* sanity check to prevent the NSString class from crashing */ /* sanity check to prevent the NSString class from crashing */
char *psz_title = input_item_GetTitleFbName(p_item->p_input); char *psz_title = input_item_GetTitleFbName(p_item->p_input);
if (psz_title) { if (psz_title) {
o_value = [NSString stringWithUTF8String: psz_title]; o_value = @(psz_title);
free(psz_title); free(psz_title);
} }
} else if ([o_identifier isEqualToString:ARTIST_COLUMN]) { } else if ([o_identifier isEqualToString:ARTIST_COLUMN]) {
psz_value = input_item_GetArtist(p_item->p_input); psz_value = input_item_GetArtist(p_item->p_input);
if (psz_value) { if (psz_value) {
o_value = [NSString stringWithUTF8String: psz_value]; o_value = @(psz_value);
free(psz_value); free(psz_value);
} }
} else if ([o_identifier isEqualToString:@"duration"]) { } else if ([o_identifier isEqualToString:@"duration"]) {
...@@ -316,45 +316,45 @@ ...@@ -316,45 +316,45 @@
mtime_t dur = input_item_GetDuration(p_item->p_input); mtime_t dur = input_item_GetDuration(p_item->p_input);
if (dur != -1) { if (dur != -1) {
secstotimestr(psz_duration, dur/1000000); secstotimestr(psz_duration, dur/1000000);
o_value = [NSString stringWithUTF8String: psz_duration]; o_value = @(psz_duration);
} }
else else
o_value = @"--:--"; o_value = @"--:--";
} else if ([o_identifier isEqualToString:GENRE_COLUMN]) { } else if ([o_identifier isEqualToString:GENRE_COLUMN]) {
psz_value = input_item_GetGenre(p_item->p_input); psz_value = input_item_GetGenre(p_item->p_input);
if (psz_value) { if (psz_value) {
o_value = [NSString stringWithUTF8String: psz_value]; o_value = @(psz_value);
free(psz_value); free(psz_value);
} }
} else if ([o_identifier isEqualToString:ALBUM_COLUMN]) { } else if ([o_identifier isEqualToString:ALBUM_COLUMN]) {
psz_value = input_item_GetAlbum(p_item->p_input); psz_value = input_item_GetAlbum(p_item->p_input);
if (psz_value) { if (psz_value) {
o_value = [NSString stringWithUTF8String: psz_value]; o_value = @(psz_value);
free(psz_value); free(psz_value);
} }
} else if ([o_identifier isEqualToString:DESCRIPTION_COLUMN]) { } else if ([o_identifier isEqualToString:DESCRIPTION_COLUMN]) {
psz_value = input_item_GetDescription(p_item->p_input); psz_value = input_item_GetDescription(p_item->p_input);
if (psz_value) { if (psz_value) {
o_value = [NSString stringWithUTF8String: psz_value]; o_value = @(psz_value);
free(psz_value); free(psz_value);
} }
} else if ([o_identifier isEqualToString:DATE_COLUMN]) { } else if ([o_identifier isEqualToString:DATE_COLUMN]) {
psz_value = input_item_GetDate(p_item->p_input); psz_value = input_item_GetDate(p_item->p_input);
if (psz_value) { if (psz_value) {
o_value = [NSString stringWithUTF8String: psz_value]; o_value = @(psz_value);
free(psz_value); free(psz_value);
} }
} else if ([o_identifier isEqualToString:LANGUAGE_COLUMN]) { } else if ([o_identifier isEqualToString:LANGUAGE_COLUMN]) {
psz_value = input_item_GetLanguage(p_item->p_input); psz_value = input_item_GetLanguage(p_item->p_input);
if (psz_value) { if (psz_value) {
o_value = [NSString stringWithUTF8String: psz_value]; o_value = @(psz_value);
free(psz_value); free(psz_value);
} }
} }
else if ([o_identifier isEqualToString:URI_COLUMN]) { else if ([o_identifier isEqualToString:URI_COLUMN]) {
psz_value = decode_URI(input_item_GetURI(p_item->p_input)); psz_value = decode_URI(input_item_GetURI(p_item->p_input));
if (psz_value) { if (psz_value) {
o_value = [NSString stringWithUTF8String: psz_value]; o_value = @(psz_value);
free(psz_value); free(psz_value);
} }
} }
...@@ -792,7 +792,7 @@ ...@@ -792,7 +792,7 @@
continue; continue;
char * psz_url = decode_URI(input_item_GetURI(p_item->p_input)); char * psz_url = decode_URI(input_item_GetURI(p_item->p_input));
o_mrl = [[NSMutableString alloc] initWithString: [NSString stringWithUTF8String: psz_url ? psz_url : ""]]; o_mrl = [[NSMutableString alloc] initWithString: @(psz_url ? psz_url : "")];
if (psz_url != NULL) if (psz_url != NULL)
free( psz_url ); free( psz_url );
...@@ -1111,11 +1111,9 @@ ...@@ -1111,11 +1111,9 @@
NSString *o_current_name, *o_current_author; NSString *o_current_name, *o_current_author;
PL_LOCK; PL_LOCK;
o_current_name = [NSString stringWithUTF8String: o_current_name = @(p_item->pp_children[i_current]->p_input->psz_name);
p_item->pp_children[i_current]->p_input->psz_name]; psz_temp = input_item_GetInfo(p_item->p_input, _("Meta-information"),_("Artist"));
psz_temp = input_item_GetInfo(p_item->p_input , o_current_author = @(psz_temp);
_("Meta-information"),_("Artist"));
o_current_author = [NSString stringWithUTF8String: psz_temp];
free(psz_temp); free(psz_temp);
PL_UNLOCK; PL_UNLOCK;
......
...@@ -216,14 +216,14 @@ static VLCInfo *_o_sharedInstance = nil; ...@@ -216,14 +216,14 @@ static VLCInfo *_o_sharedInstance = nil;
/* fill uri info */ /* fill uri info */
char * psz_url = decode_URI(input_item_GetURI(p_item)); char * psz_url = decode_URI(input_item_GetURI(p_item));
[o_uri_txt setStringValue: [NSString stringWithUTF8String: psz_url ? psz_url : ""]]; [o_uri_txt setStringValue: @(psz_url ? psz_url : "")];
free(psz_url); free(psz_url);
/* fill title info */ /* fill title info */
char * psz_title = input_item_GetTitle(p_item); char * psz_title = input_item_GetTitle(p_item);
if (!psz_title) if (!psz_title)
psz_title = input_item_GetName(p_item); psz_title = input_item_GetName(p_item);
[o_title_txt setStringValue: [NSString stringWithUTF8String: psz_title ? : "" ]]; [o_title_txt setStringValue: @(psz_title ? : "")];
free(psz_title); free(psz_title);
#define SET( foo, bar ) \ #define SET( foo, bar ) \
...@@ -252,7 +252,7 @@ static VLCInfo *_o_sharedInstance = nil; ...@@ -252,7 +252,7 @@ static VLCInfo *_o_sharedInstance = nil;
/* FIXME Can also be attachment:// */ /* FIXME Can also be attachment:// */
if (psz_meta && strncmp(psz_meta, "attachment://", 13)) if (psz_meta && strncmp(psz_meta, "attachment://", 13))
o_image = [[NSImage alloc] initWithContentsOfURL: [NSURL URLWithString:[NSString stringWithUTF8String: psz_meta]]]; o_image = [[NSImage alloc] initWithContentsOfURL: [NSURL URLWithString:@(psz_meta)]];
else else
o_image = [[NSImage imageNamed: @"noart.png"] retain]; o_image = [[NSImage imageNamed: @"noart.png"] retain];
[o_image_well setImage: o_image]; [o_image_well setImage: o_image];
...@@ -272,7 +272,7 @@ static VLCInfo *_o_sharedInstance = nil; ...@@ -272,7 +272,7 @@ static VLCInfo *_o_sharedInstance = nil;
- (void)setMeta: (char *)psz_meta forLabel: (id)theItem - (void)setMeta: (char *)psz_meta forLabel: (id)theItem
{ {
if (psz_meta != NULL && *psz_meta) if (psz_meta != NULL && *psz_meta)
[theItem setStringValue: [NSString stringWithUTF8String:psz_meta]]; [theItem setStringValue: @(psz_meta)];
else else
[theItem setStringValue: @""]; [theItem setStringValue: @""];
} }
...@@ -464,7 +464,7 @@ error: ...@@ -464,7 +464,7 @@ error:
vlc_mutex_lock(&p_item->lock); vlc_mutex_lock(&p_item->lock);
o_children = [[NSMutableArray alloc] initWithCapacity: p_item->i_categories]; o_children = [[NSMutableArray alloc] initWithCapacity: p_item->i_categories];
for (int i = 0 ; i < p_item->i_categories ; i++) { for (int i = 0 ; i < p_item->i_categories ; i++) {
NSString * name = [NSString stringWithUTF8String: p_item->pp_categories[i]->psz_name]; NSString * name = @(p_item->pp_categories[i]->psz_name);
VLCInfoTreeItem * item = [[VLCInfoTreeItem alloc] initWithName:name value:@"" ID:i parent:self]; VLCInfoTreeItem * item = [[VLCInfoTreeItem alloc] initWithName:name value:@"" ID:i parent:self];
[item autorelease]; [item autorelease];
[o_children addObject:item]; [o_children addObject:item];
...@@ -476,8 +476,8 @@ error: ...@@ -476,8 +476,8 @@ error:
info_category_t * cat = p_item->pp_categories[i_object_id]; info_category_t * cat = p_item->pp_categories[i_object_id];
o_children = [[NSMutableArray alloc] initWithCapacity: cat->i_infos]; o_children = [[NSMutableArray alloc] initWithCapacity: cat->i_infos];
for (int i = 0 ; i < cat->i_infos ; i++) { for (int i = 0 ; i < cat->i_infos ; i++) {
NSString * name = [NSString stringWithUTF8String: cat->pp_infos[i]->psz_name]; NSString * name = @(cat->pp_infos[i]->psz_name);
NSString * value = [NSString stringWithUTF8String: cat->pp_infos[i]->psz_value ? : ""]; NSString * value = @(cat->pp_infos[i]->psz_value ? : "");
VLCInfoTreeItem * item = [[VLCInfoTreeItem alloc] initWithName:name value:value ID:i parent:self]; VLCInfoTreeItem * item = [[VLCInfoTreeItem alloc] initWithName:name value:value ID:i parent:self];
[item autorelease]; [item autorelease];
[o_children addObject:item]; [o_children addObject:item];
......
...@@ -63,9 +63,8 @@ ...@@ -63,9 +63,8 @@
[o_menu addItem: o_mi]; \ [o_menu addItem: o_mi]; \
/* Ctrl */ \ /* Ctrl */ \
o_mi = [[NSMenuItem alloc] initWithTitle: \ o_mi = [[NSMenuItem alloc] initWithTitle: \
[[NSString stringWithUTF8String: \ [@(UP_ARROWHEAD) \
UP_ARROWHEAD \ stringByAppendingString: string] \
] stringByAppendingString: string] \
action:nil keyEquivalent:@""]; \ action:nil keyEquivalent:@""]; \
[o_mi setKeyEquivalentModifierMask: \ [o_mi setKeyEquivalentModifierMask: \
NSControlKeyMask]; \ NSControlKeyMask]; \
...@@ -75,9 +74,8 @@ ...@@ -75,9 +74,8 @@
[o_menu addItem: o_mi]; \ [o_menu addItem: o_mi]; \
/* Ctrl+Alt */ \ /* Ctrl+Alt */ \
o_mi = [[NSMenuItem alloc] initWithTitle: \ o_mi = [[NSMenuItem alloc] initWithTitle: \
[[NSString stringWithUTF8String: \ [@(UP_ARROWHEAD OPTION_KEY) \
UP_ARROWHEAD OPTION_KEY \ stringByAppendingString: string] \
] stringByAppendingString: string] \
action:nil keyEquivalent:@""]; \ action:nil keyEquivalent:@""]; \
[o_mi setKeyEquivalentModifierMask: \ [o_mi setKeyEquivalentModifierMask: \
NSControlKeyMask | NSAlternateKeyMask]; \ NSControlKeyMask | NSAlternateKeyMask]; \
...@@ -87,9 +85,8 @@ ...@@ -87,9 +85,8 @@
[o_menu addItem: o_mi]; \ [o_menu addItem: o_mi]; \
/* Ctrl+Shift */ \ /* Ctrl+Shift */ \
o_mi = [[NSMenuItem alloc] initWithTitle: \ o_mi = [[NSMenuItem alloc] initWithTitle: \
[[NSString stringWithUTF8String: \ [@(UP_ARROWHEAD UPWARDS_WHITE_ARROW) \
UP_ARROWHEAD UPWARDS_WHITE_ARROW \ stringByAppendingString: string] \
] stringByAppendingString: string] \
action:nil keyEquivalent:@""]; \ action:nil keyEquivalent:@""]; \
[o_mi setKeyEquivalentModifierMask: \ [o_mi setKeyEquivalentModifierMask: \
NSControlKeyMask | NSShiftKeyMask]; \ NSControlKeyMask | NSShiftKeyMask]; \
...@@ -99,9 +96,8 @@ ...@@ -99,9 +96,8 @@
[o_menu addItem: o_mi]; \ [o_menu addItem: o_mi]; \
/* Ctrl+Apple */ \ /* Ctrl+Apple */ \
o_mi = [[NSMenuItem alloc] initWithTitle: \ o_mi = [[NSMenuItem alloc] initWithTitle: \
[[NSString stringWithUTF8String: \ [@(UP_ARROWHEAD PLACE_OF_INTEREST_SIGN) \
UP_ARROWHEAD PLACE_OF_INTEREST_SIGN \ stringByAppendingString: string] \
] stringByAppendingString: string] \
action:nil keyEquivalent:@""]; \ action:nil keyEquivalent:@""]; \
[o_mi setKeyEquivalentModifierMask: \ [o_mi setKeyEquivalentModifierMask: \
NSControlKeyMask | NSCommandKeyMask]; \ NSControlKeyMask | NSCommandKeyMask]; \
...@@ -111,9 +107,8 @@ ...@@ -111,9 +107,8 @@
[o_menu addItem: o_mi]; \ [o_menu addItem: o_mi]; \
/* Ctrl+Alt+Shift */ \ /* Ctrl+Alt+Shift */ \
o_mi = [[NSMenuItem alloc] initWithTitle: \ o_mi = [[NSMenuItem alloc] initWithTitle: \
[[NSString stringWithUTF8String: \ [@(UP_ARROWHEAD OPTION_KEY UPWARDS_WHITE_ARROW) \
UP_ARROWHEAD OPTION_KEY UPWARDS_WHITE_ARROW \ stringByAppendingString: string] \
] stringByAppendingString: string] \
action:nil keyEquivalent:@""]; \ action:nil keyEquivalent:@""]; \
[o_mi setKeyEquivalentModifierMask: \ [o_mi setKeyEquivalentModifierMask: \
NSControlKeyMask | NSAlternateKeyMask | NSShiftKeyMask]; \ NSControlKeyMask | NSAlternateKeyMask | NSShiftKeyMask]; \
...@@ -124,9 +119,8 @@ ...@@ -124,9 +119,8 @@
[o_menu addItem: o_mi]; \ [o_menu addItem: o_mi]; \
/* Ctrl+Alt+Apple */ \ /* Ctrl+Alt+Apple */ \
o_mi = [[NSMenuItem alloc] initWithTitle: \ o_mi = [[NSMenuItem alloc] initWithTitle: \
[[NSString stringWithUTF8String: \ [@(UP_ARROWHEAD OPTION_KEY PLACE_OF_INTEREST_SIGN) \
UP_ARROWHEAD OPTION_KEY PLACE_OF_INTEREST_SIGN \ stringByAppendingString: string] \
] stringByAppendingString: string] \
action:nil keyEquivalent:@""]; \ action:nil keyEquivalent:@""]; \
[o_mi setKeyEquivalentModifierMask: \ [o_mi setKeyEquivalentModifierMask: \
NSControlKeyMask | NSAlternateKeyMask | NSCommandKeyMask]; \ NSControlKeyMask | NSAlternateKeyMask | NSCommandKeyMask]; \
...@@ -137,9 +131,8 @@ ...@@ -137,9 +131,8 @@
[o_menu addItem: o_mi]; \ [o_menu addItem: o_mi]; \
/* Ctrl+Shift+Apple */ \ /* Ctrl+Shift+Apple */ \
o_mi = [[NSMenuItem alloc] initWithTitle: \ o_mi = [[NSMenuItem alloc] initWithTitle: \
[[NSString stringWithUTF8String: \ [@(UP_ARROWHEAD UPWARDS_WHITE_ARROW PLACE_OF_INTEREST_SIGN) \
UP_ARROWHEAD UPWARDS_WHITE_ARROW PLACE_OF_INTEREST_SIGN \ stringByAppendingString: string] \
] stringByAppendingString: string] \
action:nil keyEquivalent:@""]; \ action:nil keyEquivalent:@""]; \
[o_mi setKeyEquivalentModifierMask: \ [o_mi setKeyEquivalentModifierMask: \
NSControlKeyMask | NSShiftKeyMask | NSCommandKeyMask]; \ NSControlKeyMask | NSShiftKeyMask | NSCommandKeyMask]; \
...@@ -150,10 +143,8 @@ ...@@ -150,10 +143,8 @@
[o_menu addItem: o_mi]; \ [o_menu addItem: o_mi]; \
/* Ctrl+Alt+Shift+Apple */ \ /* Ctrl+Alt+Shift+Apple */ \
o_mi = [[NSMenuItem alloc] initWithTitle: \ o_mi = [[NSMenuItem alloc] initWithTitle: \
[[NSString stringWithUTF8String: \ [@(UP_ARROWHEAD OPTION_KEY UPWARDS_WHITE_ARROW PLACE_OF_INTEREST_SIGN ) \
UP_ARROWHEAD OPTION_KEY UPWARDS_WHITE_ARROW \ stringByAppendingString: string] \
PLACE_OF_INTEREST_SIGN \
] stringByAppendingString: string] \
action:nil keyEquivalent:@""]; \ action:nil keyEquivalent:@""]; \
[o_mi setKeyEquivalentModifierMask: \ [o_mi setKeyEquivalentModifierMask: \
NSControlKeyMask | NSAlternateKeyMask | NSShiftKeyMask | \ NSControlKeyMask | NSAlternateKeyMask | NSShiftKeyMask | \
...@@ -165,9 +156,7 @@ ...@@ -165,9 +156,7 @@
[o_menu addItem: o_mi]; \ [o_menu addItem: o_mi]; \
/* Alt */ \ /* Alt */ \
o_mi = [[NSMenuItem alloc] initWithTitle: \ o_mi = [[NSMenuItem alloc] initWithTitle: \
[[NSString stringWithUTF8String: \ [@(OPTION_KEY) stringByAppendingString: string] \
OPTION_KEY \
] stringByAppendingString: string] \
action:nil keyEquivalent:@""]; \ action:nil keyEquivalent:@""]; \
[o_mi setKeyEquivalentModifierMask: \ [o_mi setKeyEquivalentModifierMask: \
NSAlternateKeyMask]; \ NSAlternateKeyMask]; \
...@@ -177,9 +166,7 @@ ...@@ -177,9 +166,7 @@
[o_menu addItem: o_mi]; \ [o_menu addItem: o_mi]; \
/* Alt+Shift */ \ /* Alt+Shift */ \
o_mi = [[NSMenuItem alloc] initWithTitle: \ o_mi = [[NSMenuItem alloc] initWithTitle: \
[[NSString stringWithUTF8String: \ [@(OPTION_KEY UPWARDS_WHITE_ARROW) stringByAppendingString: string] \
OPTION_KEY UPWARDS_WHITE_ARROW \
] stringByAppendingString: string] \
action:nil keyEquivalent:@""]; \ action:nil keyEquivalent:@""]; \
[o_mi setKeyEquivalentModifierMask: \ [o_mi setKeyEquivalentModifierMask: \
NSAlternateKeyMask | NSShiftKeyMask]; \ NSAlternateKeyMask | NSShiftKeyMask]; \
...@@ -189,10 +176,8 @@ ...@@ -189,10 +176,8 @@
[o_menu addItem: o_mi]; \ [o_menu addItem: o_mi]; \
/* Alt+Apple */ \ /* Alt+Apple */ \
o_mi = [[NSMenuItem alloc] initWithTitle: \ o_mi = [[NSMenuItem alloc] initWithTitle: \
[[NSString stringWithUTF8String: \ [@(OPTION_KEY PLACE_OF_INTEREST_SIGN) \
OPTION_KEY PLACE_OF_INTEREST_SIGN \ stringByAppendingString: string] action:nil keyEquivalent:@""]; \
] stringByAppendingString: string] \
action:nil keyEquivalent:@""]; \
[o_mi setKeyEquivalentModifierMask: \ [o_mi setKeyEquivalentModifierMask: \
NSAlternateKeyMask | NSCommandKeyMask]; \ NSAlternateKeyMask | NSCommandKeyMask]; \
[o_mi setAlternate: YES]; \ [o_mi setAlternate: YES]; \
...@@ -201,9 +186,8 @@ ...@@ -201,9 +186,8 @@
[o_menu addItem: o_mi]; \ [o_menu addItem: o_mi]; \
/* Alt+Shift+Apple */ \ /* Alt+Shift+Apple */ \
o_mi = [[NSMenuItem alloc] initWithTitle: \ o_mi = [[NSMenuItem alloc] initWithTitle: \
[[NSString stringWithUTF8String: \ [@(OPTION_KEY UPWARDS_WHITE_ARROW PLACE_OF_INTEREST_SIGN) \
OPTION_KEY UPWARDS_WHITE_ARROW PLACE_OF_INTEREST_SIGN \ stringByAppendingString: string] \
] stringByAppendingString: string] \
action:nil keyEquivalent:@""]; \ action:nil keyEquivalent:@""]; \
[o_mi setKeyEquivalentModifierMask: \ [o_mi setKeyEquivalentModifierMask: \
NSAlternateKeyMask | NSShiftKeyMask | NSCommandKeyMask]; \ NSAlternateKeyMask | NSShiftKeyMask | NSCommandKeyMask]; \
...@@ -214,9 +198,8 @@ ...@@ -214,9 +198,8 @@
[o_menu addItem: o_mi]; \ [o_menu addItem: o_mi]; \
/* Shift */ \ /* Shift */ \
o_mi = [[NSMenuItem alloc] initWithTitle: \ o_mi = [[NSMenuItem alloc] initWithTitle: \
[[NSString stringWithUTF8String: \ [@(UPWARDS_WHITE_ARROW) \
UPWARDS_WHITE_ARROW \ stringByAppendingString: string] \
] stringByAppendingString: string] \
action:nil keyEquivalent:@""]; \ action:nil keyEquivalent:@""]; \
[o_mi setKeyEquivalentModifierMask: \ [o_mi setKeyEquivalentModifierMask: \
NSShiftKeyMask]; \ NSShiftKeyMask]; \
...@@ -226,9 +209,8 @@ ...@@ -226,9 +209,8 @@
[o_menu addItem: o_mi]; \ [o_menu addItem: o_mi]; \
/* Shift+Apple */ \ /* Shift+Apple */ \
o_mi = [[NSMenuItem alloc] initWithTitle: \ o_mi = [[NSMenuItem alloc] initWithTitle: \
[[NSString stringWithUTF8String: \ [@(UPWARDS_WHITE_ARROW PLACE_OF_INTEREST_SIGN) \
UPWARDS_WHITE_ARROW PLACE_OF_INTEREST_SIGN \ stringByAppendingString: string] \
] stringByAppendingString: string] \
action:nil keyEquivalent:@""]; \ action:nil keyEquivalent:@""]; \
[o_mi setKeyEquivalentModifierMask: \ [o_mi setKeyEquivalentModifierMask: \
NSShiftKeyMask | NSCommandKeyMask]; \ NSShiftKeyMask | NSCommandKeyMask]; \
...@@ -238,9 +220,8 @@ ...@@ -238,9 +220,8 @@
[o_menu addItem: o_mi]; \ [o_menu addItem: o_mi]; \
/* Apple */ \ /* Apple */ \
o_mi = [[NSMenuItem alloc] initWithTitle: \ o_mi = [[NSMenuItem alloc] initWithTitle: \
[[NSString stringWithUTF8String: \ [@(PLACE_OF_INTEREST_SIGN) \
PLACE_OF_INTEREST_SIGN \ stringByAppendingString: string] \
] stringByAppendingString: string] \
action:nil keyEquivalent:@""]; \ action:nil keyEquivalent:@""]; \
[o_mi setKeyEquivalentModifierMask: \ [o_mi setKeyEquivalentModifierMask: \
NSCommandKeyMask]; \ NSCommandKeyMask]; \
...@@ -1939,8 +1920,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -1939,8 +1920,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
for (i = 0; i < sizeof(vlc_key) / sizeof(key_descriptor_t); i++) for (i = 0; i < sizeof(vlc_key) / sizeof(key_descriptor_t); i++)
if (vlc_key[i].psz_key_string) if (vlc_key[i].psz_key_string)
POPULATE_A_KEY(o_keys_menu, POPULATE_A_KEY(o_keys_menu,
[NSString stringWithUTF8String:vlc_key[i].psz_key_string] @(vlc_key[i].psz_key_string),
, vlc_key[i].i_key_code) vlc_key[i].i_key_code)
#endif #endif
} }
[o_popup setMenu:[o_keys_menu copyWithZone:nil]]; [o_popup setMenu:[o_keys_menu copyWithZone:nil]];
...@@ -2020,10 +2001,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \ ...@@ -2020,10 +2001,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
/* Hack: required subcategory is stored in i_min */ /* Hack: required subcategory is stored in i_min */
if (p_config->i_type == CONFIG_SUBCATEGORY && if (p_config->i_type == CONFIG_SUBCATEGORY &&
p_config->value.i == _p_item->min.i) { p_config->value.i == _p_item->min.i) {
o_modulelongname = [NSString stringWithUTF8String: o_modulelongname = @(module_get_name(p_parser, TRUE));
module_get_name(p_parser, TRUE)]; o_modulename = @(module_get_object(p_parser));
o_modulename = [NSString stringWithUTF8String:
module_get_object(p_parser)];
if (_p_item->value.psz && if (_p_item->value.psz &&
strstr(_p_item->value.psz, module_get_object(p_parser))) strstr(_p_item->value.psz, module_get_object(p_parser)))
......
...@@ -330,10 +330,10 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam ...@@ -330,10 +330,10 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
continue; continue;
} }
else if (p_item->list.psz[i]) else if (p_item->list.psz[i])
mi = [[NSMenuItem alloc] initWithTitle: [NSString stringWithUTF8String: p_item->list.psz[i]] action:NULL keyEquivalent: @""]; mi = [[NSMenuItem alloc] initWithTitle: @(p_item->list.psz[i]) action:NULL keyEquivalent: @""];
else else
msg_Err(p_intf, "item %d of pref %s failed to be created", i, name); msg_Err(p_intf, "item %d of pref %s failed to be created", i, name);
[mi setRepresentedObject:[NSString stringWithUTF8String: p_item->list.psz[i]]]; [mi setRepresentedObject:@(p_item->list.psz[i])];
[[object menu] addItem: [mi autorelease]]; [[object menu] addItem: [mi autorelease]];
if (p_item->value.psz && !strcmp(p_item->value.psz, p_item->list.psz[i])) if (p_item->value.psz && !strcmp(p_item->value.psz, p_item->list.psz[i]))
[object selectItem:[object lastItem]]; [object selectItem:[object lastItem]];
...@@ -388,7 +388,7 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam ...@@ -388,7 +388,7 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
for (size_t i_index = 0; i_index < count; i_index++) { for (size_t i_index = 0; i_index < count; i_index++) {
p_parser = p_list[i_index]; p_parser = p_list[i_index];
if (module_provides(p_parser, p_item->psz_type)) { if (module_provides(p_parser, p_item->psz_type)) {
[object addItemWithTitle: [NSString stringWithUTF8String: _(module_GetLongName(p_parser)) ?: ""]]; [object addItemWithTitle: @(_(module_GetLongName(p_parser)) ?: "")];
if (p_item->value.psz && !strcmp(p_item->value.psz, module_get_name(p_parser, false))) if (p_item->value.psz && !strcmp(p_item->value.psz, module_get_name(p_parser, false)))
[object selectItem: [object lastItem]]; [object selectItem: [object lastItem]];
} }
...@@ -406,7 +406,7 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam ...@@ -406,7 +406,7 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
- (void)setupField:(NSTextField *)o_object forOption:(const char *)psz_option - (void)setupField:(NSTextField *)o_object forOption:(const char *)psz_option
{ {
char *psz_tmp = config_GetPsz(p_intf, psz_option); char *psz_tmp = config_GetPsz(p_intf, psz_option);
[o_object setStringValue: [NSString stringWithUTF8String: psz_tmp ?: ""]]; [o_object setStringValue: @(psz_tmp ?: "")];
[o_object setToolTip: _NS(config_GetLabel(p_intf, psz_option))]; [o_object setToolTip: _NS(config_GetLabel(p_intf, psz_option))];
free(psz_tmp); free(psz_tmp);
} }
...@@ -633,9 +633,9 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam ...@@ -633,9 +633,9 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
&& !strncmp(p_item->psz_name , "key-", 4) && !strncmp(p_item->psz_name , "key-", 4)
&& !EMPTY_STR(p_item->psz_text)) { && !EMPTY_STR(p_item->psz_text)) {
[o_tempArray_desc addObject: _NS(p_item->psz_text)]; [o_tempArray_desc addObject: _NS(p_item->psz_text)];
[o_tempArray_names addObject: [NSString stringWithUTF8String:p_item->psz_name]]; [o_tempArray_names addObject: @(p_item->psz_name)];
if (p_item->value.psz) if (p_item->value.psz)
[o_hotkeySettings addObject: [NSString stringWithUTF8String:p_item->value.psz]]; [o_hotkeySettings addObject: @(p_item->value.psz)];
else else
[o_hotkeySettings addObject: [NSString string]]; [o_hotkeySettings addObject: [NSString string]];
} }
...@@ -1114,7 +1114,7 @@ static inline void save_module_list(intf_thread_t * p_intf, id object, const cha ...@@ -1114,7 +1114,7 @@ static inline void save_module_list(intf_thread_t * p_intf, id object, const cha
- (IBAction)showFontPicker:(id)sender - (IBAction)showFontPicker:(id)sender
{ {
char * font = config_GetPsz(p_intf, "freetype-font"); char * font = config_GetPsz(p_intf, "freetype-font");
NSString * fontName = font ? [NSString stringWithUTF8String: font] : nil; NSString * fontName = font ? @(font) : nil;
free(font); free(font);
if (fontName) { if (fontName) {
NSFont * font = [NSFont fontWithName:fontName size:0.0]; NSFont * font = [NSFont fontWithName:fontName size:0.0];
......
...@@ -553,7 +553,7 @@ static VLCWizard *_o_sharedInstance = nil; ...@@ -553,7 +553,7 @@ static VLCWizard *_o_sharedInstance = nil;
if (p_item->i_children <= 0) if (p_item->i_children <= 0)
{ {
char *psz_uri = input_item_GetURI( p_item->p_input); char *psz_uri = input_item_GetURI( p_item->p_input);
[tempArray addObject: [NSString stringWithUTF8String: psz_uri]]; [tempArray addObject: @(psz_uri)];
free( psz_uri); free( psz_uri);
stop = NO; stop = NO;
} }
......
...@@ -276,7 +276,7 @@ void updateProgressPanel (void *priv, const char *text, float value) ...@@ -276,7 +276,7 @@ void updateProgressPanel (void *priv, const char *text, float value)
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithFloat:value], @"value", [NSNumber numberWithFloat:value], @"value",
text ? [NSString stringWithUTF8String:text] : nil, @"text", text ? @(text) : nil, @"text",
nil]; nil];
[sys->displayer performSelectorOnMainThread:@selector(updateProgressPanel:) withObject:dict waitUntilDone:YES]; [sys->displayer performSelectorOnMainThread:@selector(updateProgressPanel:) withObject:dict waitUntilDone:YES];
...@@ -329,15 +329,15 @@ bool checkProgressPanel (void *priv) ...@@ -329,15 +329,15 @@ bool checkProgressPanel (void *priv)
{ {
NSMutableDictionary *dict = [NSMutableDictionary dictionary]; NSMutableDictionary *dict = [NSMutableDictionary dictionary];
if (title) if (title)
[dict setObject:[NSString stringWithUTF8String:title] forKey:@"title"]; [dict setObject:@(title) forKey:@"title"];
if (message) if (message)
[dict setObject:[NSString stringWithUTF8String:message] forKey:@"message"]; [dict setObject:@(message) forKey:@"message"];
if (yes) if (yes)
[dict setObject:[NSString stringWithUTF8String:yes] forKey:@"yes"]; [dict setObject:@(yes) forKey:@"yes"];
if (no) if (no)
[dict setObject:[NSString stringWithUTF8String:no] forKey:@"no"]; [dict setObject:@(no) forKey:@"no"];
if (cancel) if (cancel)
[dict setObject:[NSString stringWithUTF8String:cancel] forKey:@"cancel"]; [dict setObject:@(cancel) forKey:@"cancel"];
return dict; return dict;
} }
...@@ -672,7 +672,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -672,7 +672,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
// //
// assert([control isKindOfClass:[NSTextView class]]); // assert([control isKindOfClass:[NSTextView class]]);
// NSTextView *textView = (NSTextView *)control; // NSTextView *textView = (NSTextView *)control;
// NSString *string = [NSString stringWithUTF8String:widget->psz_text]; // NSString *string = @(widget->psz_text);
// NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding:NSISOLatin1StringEncoding] documentAttributes:NULL]; // NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding:NSISOLatin1StringEncoding] documentAttributes:NULL];
// [[textView textStorage] setAttributedString:[[NSAttributedString alloc] initWithString:@"Hello"]]; // [[textView textStorage] setAttributedString:[[NSAttributedString alloc] initWithString:@"Hello"]];
// [textView setNeedsDisplay:YES]; // [textView setNeedsDisplay:YES];
...@@ -684,7 +684,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -684,7 +684,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
{ {
assert([control isKindOfClass:[NSTextView class]]); assert([control isKindOfClass:[NSTextView class]]);
NSTextView *textView = (NSTextView *)control; NSTextView *textView = (NSTextView *)control;
NSString *string = [NSString stringWithUTF8String:widget->psz_text]; NSString *string = @(widget->psz_text);
NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding:NSISOLatin1StringEncoding] documentAttributes:NULL]; NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding:NSISOLatin1StringEncoding] documentAttributes:NULL];
[[textView textStorage] setAttributedString:attrString]; [[textView textStorage] setAttributedString:attrString];
[textView setNeedsDisplay:YES]; [textView setNeedsDisplay:YES];
...@@ -701,7 +701,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -701,7 +701,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
break; break;
assert([control isKindOfClass:[NSControl class]]); assert([control isKindOfClass:[NSControl class]]);
NSControl *field = (NSControl *)control; NSControl *field = (NSControl *)control;
NSString *string = [NSString stringWithUTF8String:widget->psz_text]; NSString *string = @(widget->psz_text);
NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding:NSISOLatin1StringEncoding] documentAttributes:NULL]; NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding:NSISOLatin1StringEncoding] documentAttributes:NULL];
[field setAttributedStringValue:attrString]; [field setAttributedStringValue:attrString];
[attrString release]; [attrString release];
...@@ -714,7 +714,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -714,7 +714,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
NSButton *button = (NSButton *)control; NSButton *button = (NSButton *)control;
if (!widget->psz_text) if (!widget->psz_text)
break; break;
[button setTitle:[NSString stringWithUTF8String:widget->psz_text]]; [button setTitle:@(widget->psz_text)];
break; break;
} }
case EXTENSION_WIDGET_DROPDOWN: case EXTENSION_WIDGET_DROPDOWN:
...@@ -725,7 +725,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -725,7 +725,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
struct extension_widget_value_t *value; struct extension_widget_value_t *value;
for(value = widget->p_values; value != NULL; value = value->p_next) for(value = widget->p_values; value != NULL; value = value->p_next)
{ {
[popup addItemWithTitle:[NSString stringWithUTF8String:value->psz_text]]; [popup addItemWithTitle:@(value->psz_text)];
} }
[popup synchronizeTitleAndSelectedItem]; [popup synchronizeTitleAndSelectedItem];
[self popUpSelectionChanged:popup]; [self popUpSelectionChanged:popup];
...@@ -745,7 +745,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -745,7 +745,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
{ {
NSDictionary *entry = [NSDictionary dictionaryWithObjectsAndKeys: NSDictionary *entry = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:value->i_id], @"id", [NSNumber numberWithInt:value->i_id], @"id",
[NSString stringWithUTF8String:value->psz_text], @"text", @(value->psz_text), @"text",
nil]; nil];
[contentArray addObject:entry]; [contentArray addObject:entry];
} }
...@@ -757,7 +757,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -757,7 +757,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
{ {
assert([control isKindOfClass:[NSImageView class]]); assert([control isKindOfClass:[NSImageView class]]);
NSImageView *imageView = (NSImageView *)control; NSImageView *imageView = (NSImageView *)control;
NSString *string = widget->psz_text ? [NSString stringWithUTF8String:widget->psz_text] : nil; NSString *string = widget->psz_text ? @(widget->psz_text) : nil;
NSImage *image = nil; NSImage *image = nil;
if (string) if (string)
image = [[NSImage alloc] initWithContentsOfURL:[NSURL fileURLWithPath:string]]; image = [[NSImage alloc] initWithContentsOfURL:[NSURL fileURLWithPath:string]];
...@@ -855,7 +855,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -855,7 +855,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
window = [[VLCDialogWindow alloc] initWithContentRect:content styleMask:NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask backing:NSBackingStoreBuffered defer:NO]; window = [[VLCDialogWindow alloc] initWithContentRect:content styleMask:NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask backing:NSBackingStoreBuffered defer:NO];
[window setDelegate:self]; [window setDelegate:self];
[window setDialog:dialog]; [window setDialog:dialog];
[window setTitle:[NSString stringWithUTF8String:dialog->psz_title]]; [window setTitle:@(dialog->psz_title)];
VLCDialogGridView *gridView = [[VLCDialogGridView alloc] init]; VLCDialogGridView *gridView = [[VLCDialogGridView alloc] init];
[gridView setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable]; [gridView setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
[window setContentView:gridView]; [window setContentView:gridView];
......
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