Commit 2f854ae3 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: deploy string conversation function in more cases

parent 5289253f
......@@ -86,8 +86,8 @@
eqz_preset_10b[i].f_amp[9]];
[workValues addObject:workString];
[workPreamp addObject:[NSString stringWithFormat:@"%1.f", eqz_preset_10b[i].f_preamp]];
[workTitles addObject:[NSString stringWithUTF8String:preset_list_text[i]]];
[workNames addObject:[NSString stringWithUTF8String:preset_list[i]]];
[workTitles addObject:toNSStr(preset_list_text[i])];
[workNames addObject:toNSStr(preset_list[i])];
}
NSString *defaultProfile = [NSString stringWithFormat:@"ZmxhdA==;;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%i",
......
......@@ -315,7 +315,7 @@
[openPanel beginSheetModalForWindow:_window completionHandler:^(NSInteger returnCode) {
if (returnCode == NSOKButton)
{
[self setMRL: [NSString stringWithUTF8String:vlc_path2uri([[[openPanel URL] path] UTF8String], NULL)]];
[self setMRL: toNSStr(vlc_path2uri([[[openPanel URL] path] UTF8String], NULL))];
[self updateOKButton];
[self updateDropView];
}
......@@ -541,7 +541,7 @@
NSArray *values = [[paste propertyListForType: NSFilenamesPboardType] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
if ([values count] > 0) {
[self setMRL: [NSString stringWithUTF8String:vlc_path2uri([[values firstObject] UTF8String], NULL)]];
[self setMRL: toNSStr(vlc_path2uri([[values firstObject] UTF8String], NULL))];
[self updateOKButton];
[self updateDropView];
return YES;
......
......@@ -278,7 +278,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
}
NSURL *o_url;
o_url = [NSURL URLWithString:[NSString stringWithUTF8String:psz_uri]];
o_url = [NSURL URLWithString:toNSStr(psz_uri)];
vlc_object_release(p_input);
return o_url;
......@@ -315,7 +315,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
free(formated);
}
NSURL * o_url = [NSURL URLWithString:[NSString stringWithUTF8String:psz_uri]];
NSURL * o_url = [NSURL URLWithString:toNSStr(psz_uri)];
free(psz_uri);
if ([o_name isEqualToString:@""]) {
......@@ -659,7 +659,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
if (!psz_uri)
continue;
o_dic = [NSDictionary dictionaryWithObject:[NSString stringWithCString:psz_uri encoding:NSUTF8StringEncoding] forKey:@"ITEM_URL"];
o_dic = [NSDictionary dictionaryWithObject:toNSStr(psz_uri) forKey:@"ITEM_URL"];
free(psz_uri);
o_array = [o_array arrayByAddingObject: o_dic];
......@@ -1309,7 +1309,7 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
&& !strncmp(p_item->psz_name , "key-", 4)
&& !EMPTY_STR(p_item->psz_text)) {
if (p_item->value.psz)
[mutArray addObject: [NSString stringWithUTF8String:p_item->value.psz]];
[mutArray addObject:toNSStr(p_item->value.psz)];
}
}
module_config_free (p_config);
......
......@@ -209,7 +209,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
{
NSDictionary *entry = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:value->i_id], @"id",
[NSString stringWithUTF8String:value->psz_text], @"text",
toNSStr(value->psz_text), @"text",
nil];
[contentArray addObject:entry];
}
......@@ -221,7 +221,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
{
assert([control isKindOfClass:[NSImageView class]]);
NSImageView *imageView = (NSImageView *)control;
NSString *string = widget->psz_text ? [NSString stringWithUTF8String:widget->psz_text] : nil;
NSString *string = widget->psz_text ? toNSStr(widget->psz_text) : nil;
NSImage *image = nil;
if (string)
image = [[NSImage alloc] initWithContentsOfURL:[NSURL fileURLWithPath:string]];
......@@ -303,7 +303,7 @@ static int extensionDialogCallback(vlc_object_t *p_this, const char *psz_variabl
- (void)performEventWithObject:(NSValue *)objectValue ofType:(const char*)type
{
NSString *typeString = [NSString stringWithUTF8String:type];
NSString *typeString = toNSStr(type);
if ([typeString isEqualToString: @"dialog-extension"]) {
[self performSelectorOnMainThread:@selector(updateExtensionDialog:)
......
......@@ -323,7 +323,7 @@
[mi setTarget:self];
[mi setAction:selector];
[mi setTag:p_item->list.i[i]];
[mi setRepresentedObject:[NSString stringWithUTF8String:psz_name]];
[mi setRepresentedObject:toNSStr(psz_name)];
[menu addItem:mi];
if (p_item->value.i == p_item->list.i[i])
[mi setState:NSOnState];
......@@ -1117,7 +1117,7 @@
[openPanel setAllowedFileTypes: [NSArray arrayWithObjects:@"cdg",@"idx",@"srt",@"sub",@"utf",@"ass",@"ssa",@"aqt",@"jss",@"psb",@"rt",@"smi",@"txt",@"smil",nil]];
NSURL *url = [NSURL URLWithString:[[NSString stringWithUTF8String:path] stringByExpandingTildeInPath]];
NSURL *url = [NSURL URLWithString:[toNSStr(path) stringByExpandingTildeInPath]];
url = [url URLByDeletingLastPathComponent];
[openPanel setDirectoryURL: url];
free(path);
......
......@@ -344,25 +344,25 @@ static VLCMainWindow *sharedInstance = nil;
NSMutableArray *mycompItems = [[NSMutableArray alloc] init];
NSString *o_identifier;
for (; ppsz_name && *ppsz_name; ppsz_name++, ppsz_longname++, p_category++) {
o_identifier = [NSString stringWithCString: *ppsz_name encoding: NSUTF8StringEncoding];
o_identifier = toNSStr(*ppsz_name);
switch (*p_category) {
case SD_CAT_INTERNET:
[internetItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]];
[[internetItems lastObject] setIcon: imageFromRes(@"sidebar-podcast")];
[[internetItems lastObject] setSdtype: SD_CAT_INTERNET];
[[internetItems lastObject] setUntranslatedTitle: [NSString stringWithUTF8String:*ppsz_longname]];
[[internetItems lastObject] setUntranslatedTitle: toNSStr(*ppsz_longname)];
break;
case SD_CAT_DEVICES:
[devicesItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]];
[[devicesItems lastObject] setIcon: imageFromRes(@"sidebar-local")];
[[devicesItems lastObject] setSdtype: SD_CAT_DEVICES];
[[devicesItems lastObject] setUntranslatedTitle: [NSString stringWithUTF8String:*ppsz_longname]];
[[devicesItems lastObject] setUntranslatedTitle: toNSStr(*ppsz_longname)];
break;
case SD_CAT_LAN:
[lanItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]];
[[lanItems lastObject] setIcon: imageFromRes(@"sidebar-local")];
[[lanItems lastObject] setSdtype: SD_CAT_LAN];
[[lanItems lastObject] setUntranslatedTitle: [NSString stringWithUTF8String:*ppsz_longname]];
[[lanItems lastObject] setUntranslatedTitle: toNSStr(*ppsz_longname)];
break;
case SD_CAT_MYCOMPUTER:
[mycompItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]];
......@@ -374,7 +374,7 @@ static VLCMainWindow *sharedInstance = nil;
[[mycompItems lastObject] setIcon: imageFromRes(@"sidebar-pictures")];
else
[[mycompItems lastObject] setIcon: [NSImage imageNamed:@"NSApplicationIcon"]];
[[mycompItems lastObject] setUntranslatedTitle: [NSString stringWithUTF8String:*ppsz_longname]];
[[mycompItems lastObject] setUntranslatedTitle: toNSStr(*ppsz_longname)];
[[mycompItems lastObject] setSdtype: SD_CAT_MYCOMPUTER];
break;
default:
......@@ -694,11 +694,11 @@ static VLCMainWindow *sharedInstance = nil;
free(formated);
}
} else
aString = [NSString stringWithUTF8String:config_GetPsz(VLCIntf, "video-title")];
aString = toNSStr(config_GetPsz(VLCIntf, "video-title"));
char *uri = input_item_GetURI(input_GetItem(p_input));
NSURL * o_url = [NSURL URLWithString:[NSString stringWithUTF8String:uri]];
NSURL * o_url = [NSURL URLWithString:toNSStr(uri)];
if ([o_url isFileURL]) {
[self setRepresentedURL: o_url];
[[[VLCMain sharedInstance] voutController] updateWindowsUsingBlock:^(VLCVideoWindowCommon *o_window) {
......@@ -1198,7 +1198,7 @@ static VLCMainWindow *sharedInstance = nil;
if (!psz_uri)
continue;
o_dic = [NSDictionary dictionaryWithObject:[NSString stringWithCString:psz_uri encoding:NSUTF8StringEncoding] forKey:@"ITEM_URL"];
o_dic = [NSDictionary dictionaryWithObject:toNSStr(psz_uri) forKey:@"ITEM_URL"];
free(psz_uri);
......@@ -1294,7 +1294,7 @@ static VLCMainWindow *sharedInstance = nil;
playlist_t * p_playlist = pl_Get(VLCIntf);
char *psz_urls = var_InheritString(p_playlist, "podcast-urls");
NSMutableArray * urls = [[NSMutableArray alloc] initWithArray:[[NSString stringWithUTF8String:config_GetPsz(VLCIntf, "podcast-urls")] componentsSeparatedByString:@"|"]];
NSMutableArray * urls = [[NSMutableArray alloc] initWithArray:[toNSStr(config_GetPsz(VLCIntf, "podcast-urls")) componentsSeparatedByString:@"|"]];
[urls removeObjectAtIndex: [o_podcast_unsubscribe_pop indexOfSelectedItem]];
const char *psz_new_urls = [[urls componentsJoinedByString:@"|"] UTF8String];
var_SetString(pl_Get(VLCIntf), "podcast-urls", psz_new_urls);
......
......@@ -68,7 +68,7 @@ NSString *const kVLCMediaUnknown = @"Unknown";
NSString * stringObject = nil;
if (psz != NULL) {
stringObject = [NSString stringWithCString: _(psz) encoding:NSUTF8StringEncoding];
stringObject = toNSStr(_(psz));
if (stringObject == NULL) {
msg_Err(VLCIntf, "could not translate: %s", psz);
......@@ -133,7 +133,7 @@ NSString *const kVLCMediaUnknown = @"Unknown";
remaining = dur - t;
return [NSString stringWithFormat: @"-%s", secstotimestr(psz_time, (remaining / 1000000))];
} else
return [NSString stringWithUTF8String:secstotimestr(psz_time, t / CLOCK_FREQ )];
return toNSStr(secstotimestr(psz_time, t / CLOCK_FREQ ));
}
- (NSString *)stringForTime:(long long int)time
......
......@@ -344,7 +344,7 @@
[_adjustHueSlider setToolTip: [NSString stringWithFormat:@"%.0f", config_GetFloat(p_intf, "hue")]];
[_adjustSaturationSlider setToolTip: [NSString stringWithFormat:@"%0.3f", config_GetFloat(p_intf, "saturation")]];
b_state = [_adjustCheckbox state];
#if 0
[_adjustBrightnessSlider setEnabled: b_state];
[_adjustBrightnessCheckbox setEnabled: b_state];
[_adjustContrastSlider setEnabled: b_state];
......@@ -381,7 +381,7 @@
[_cropSyncLeftRightCheckbox setState: NSOffState];
tmpChar = config_GetPsz(p_intf, "transform-type");
tmpString = [NSString stringWithUTF8String:tmpChar];
tmpString = toNSStr(tmpChar);
if ([tmpString isEqualToString:@"hflip"])
[_transformPopup selectItemWithTag: 1];
else if ([tmpString isEqualToString:@"vflip"])
......@@ -400,9 +400,7 @@
[_puzzleColumnsTextField setEnabled: b_state];
[_puzzleColumnsStepper setEnabled: b_state];
[_puzzleColumnsLabel setEnabled: b_state];
#endif
#if 0
[self setCloneValue: config_GetInt(p_intf, "clone-count")];
b_state = [_cloneCheckbox state];
[_cloneNumberLabel setEnabled: b_state];
......@@ -440,7 +438,7 @@
[_sepiaLabel setEnabled: b_state];
tmpChar = config_GetPsz(p_intf, "gradient-mode");
tmpString = [NSString stringWithUTF8String:tmpChar];
tmpString = toNSStr(tmpChar);
if ([tmpString isEqualToString:@"hough"])
[_gradientModePopup selectItemWithTag: 3];
else if ([tmpString isEqualToString:@"edge"])
......@@ -455,8 +453,7 @@
[_gradientModeLabel setEnabled: b_state];
[_gradientCartoonCheckbox setEnabled: b_state];
[_gradientColorCheckbox setEnabled: b_state];
#endif
#if 0
[_extractTextField setStringValue: [[NSString stringWithFormat:@"%llx", config_GetInt(p_intf, "extract-component")] uppercaseString]];
[_extractTextField setEnabled: [_extractCheckbox state]];
[_extractLabel setEnabled: [_extractCheckbox state]];
......@@ -473,11 +470,9 @@
[_blurLabel setEnabled: [_blurCheckbox state]];
tmpChar = config_GetPsz(p_intf, "marq-marquee");
if (tmpChar) {
[_addTextTextTextField setStringValue: [NSString stringWithUTF8String:tmpChar]];
[_addTextTextTextField setStringValue:toNSStr(tmpChar)];
if (tmpChar)
FREENULL(tmpChar);
} else
[_addTextTextTextField setStringValue: @""];
[_addTextPositionPopup selectItemWithTag: config_GetInt(p_intf, "marq-position")];
b_state = [_addTextCheckbox state];
[_addTextPositionPopup setEnabled: b_state];
......@@ -486,11 +481,9 @@
[_addTextTextTextField setEnabled: b_state];
tmpChar = config_GetPsz(p_intf, "logo-file");
if (tmpChar) {
[_addLogoLogoTextField setStringValue: [NSString stringWithUTF8String:tmpChar]];
[_addLogoLogoTextField setStringValue: toNSStr(tmpChar)];
if (tmpChar)
FREENULL(tmpChar);
} else
[_addLogoLogoTextField setStringValue: @""];
[_addLogoPositionPopup selectItemWithTag: config_GetInt(p_intf, "logo-position")];
[_addLogoTransparencySlider setIntValue: config_GetInt(p_intf, "logo-opacity")];
[_addLogoTransparencySlider setToolTip: [NSString stringWithFormat:@"%lli", config_GetInt(p_intf, "logo-opacity")]];
......@@ -501,7 +494,6 @@
[_addLogoLogoLabel setEnabled: b_state];
[_addLogoTransparencySlider setEnabled: b_state];
[_addLogoTransparencyLabel setEnabled: b_state];
#endif
}
- (NSString *)generateProfileString
......
......@@ -125,7 +125,7 @@
/* Setup the nameversion field */
[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: [toNSStr(psz_authors) componentsSeparatedByString:@"\n\n"]];
NSUInteger count = [tmpArray count];
for (NSUInteger i = 0; i < count; i++) {
[tmpArray replaceObjectAtIndex:i withObject:[[tmpArray objectAtIndex:i]stringByReplacingOccurrencesOfString:@"\n" withString:@", "]];
......@@ -136,15 +136,15 @@
o_authors = [tmpArray componentsJoinedByString:@"\n\n"];
/* setup join us! */
NSString *joinus = [NSString stringWithUTF8String:_(""
"<p>VLC media player is a free and open source media player, encoder, and "
"streamer made by the volunteers of the <a href=\"http://www.videolan.org/"
"\"><span style=\" text-decoration: underline; color:#0057ae;\">VideoLAN</"
"span></a> community.</p><p>VLC uses its internal codecs, works on "
"essentially every popular platform, and can read almost all files, CDs, "
"DVDs, network streams, capture cards and other media formats!</p><p><a href="
"\"http://www.videolan.org/contribute/\"><span style=\" text-decoration: "
"underline; color:#0057ae;\">Help and join us!</span></a>")];
NSString *joinus = toNSStr(_(""
"<p>VLC media player is a free and open source media player, encoder, and "
"streamer made by the volunteers of the <a href=\"http://www.videolan.org/"
"\"><span style=\" text-decoration: underline; color:#0057ae;\">VideoLAN</"
"span></a> community.</p><p>VLC uses its internal codecs, works on "
"essentially every popular platform, and can read almost all files, CDs, "
"DVDs, network streams, capture cards and other media formats!</p><p><a href="
"\"http://www.videolan.org/contribute/\"><span style=\" text-decoration: "
"underline; color:#0057ae;\">Help and join us!</span></a>"));
NSString *fontfamily;
if (OSX_YOSEMITE)
fontfamily = @"Helvetica Neue";
......@@ -236,9 +236,9 @@
if (sender == o_authors_btn)
[o_credits_textview setString:o_authors];
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:[toNSStr(psz_thanks) stringByReplacingOccurrencesOfString:@"\n" withString:@" " options:0 range:NSRangeFromString(@"680 2")]];
else
[o_credits_textview setString:[NSString stringWithUTF8String:psz_license]];
[o_credits_textview setString:toNSStr(psz_license)];
[o_credits_textview scrollPoint:NSMakePoint(0, 0)];
b_restart = YES;
......
......@@ -36,7 +36,7 @@ static void destroyProgressPanel (void *);
static int DialogCallback(vlc_object_t *p_this, const char *type, vlc_value_t previous, vlc_value_t value, void *data)
{
@autoreleasepool {
if ([[NSString stringWithUTF8String:type] isEqualToString: @"dialog-progress-bar"]) {
if ([toNSStr(type) isEqualToString: @"dialog-progress-bar"]) {
/* 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;
......@@ -145,7 +145,7 @@ bool checkProgressPanel (void *priv)
-(void)performEventWithObject: (NSValue *)o_value ofType: (const char*)type
{
NSString *o_type = [NSString stringWithUTF8String:type];
NSString *o_type = toNSStr(type);
if ([o_type isEqualToString: @"dialog-error"])
[self performSelectorOnMainThread:@selector(showFatalDialog:) withObject:o_value waitUntilDone:YES];
......@@ -241,7 +241,7 @@ bool checkProgressPanel (void *priv)
[o_prog_title_txt setStringValue: toNSStr(p_dialog->title)];
if (p_dialog->cancel != NULL)
[o_prog_cancel_btn setTitle: [NSString stringWithUTF8String:p_dialog->cancel]];
[o_prog_cancel_btn setTitle: toNSStr(p_dialog->cancel)];
else
[o_prog_cancel_btn setTitle: _NS("Cancel")];
......
......@@ -563,14 +563,14 @@
remaining = dur - t;
o_total_time = [NSString stringWithFormat: @"-%s", secstotimestr(psz_time, (remaining / 1000000))];
} else
o_total_time = [NSString stringWithUTF8String:secstotimestr(psz_time, (dur / 1000000))];
o_total_time = toNSStr(secstotimestr(psz_time, (dur / 1000000)));
[o_streamLength_txt setStringValue: o_total_time];
}
// update current position (left field)
NSString *o_playback_pos = [NSString stringWithUTF8String:secstotimestr(psz_time, t / CLOCK_FREQ)];
NSString *o_playback_pos = toNSStr(secstotimestr(psz_time, t / CLOCK_FREQ));
[o_streamPosition_txt setStringValue: o_playback_pos];
vlc_object_release(p_input);
} else {
......
......@@ -469,7 +469,7 @@ static int ShowController(vlc_object_t *p_this, const char *psz_variable,
if (!psz_uri)
continue;
NSDictionary *o_dic = [NSDictionary dictionaryWithObject:[NSString stringWithCString:psz_uri encoding:NSUTF8StringEncoding] forKey:@"ITEM_URL"];
NSDictionary *o_dic = [NSDictionary dictionaryWithObject:toNSStr(psz_uri) forKey:@"ITEM_URL"];
free(psz_uri);
[o_result addObject: o_dic];
}
......
......@@ -647,7 +647,7 @@ struct display_info_t
char *psz_uri = vlc_path2uri([values[i] UTF8String], "file");
if (!psz_uri)
continue;
dictionary = [NSDictionary dictionaryWithObject:[NSString stringWithCString:psz_uri encoding:NSUTF8StringEncoding] forKey:@"ITEM_URL"];
dictionary = [NSDictionary dictionaryWithObject:toNSStr(psz_uri) forKey:@"ITEM_URL"];
NSLog(@"dict: %@", dictionary);
free(psz_uri);
[array addObject: dictionary];
......@@ -689,7 +689,7 @@ struct display_info_t
char *psz_uri = vlc_path2uri([_filePath UTF8String], "file");
if (!psz_uri) return;
NSMutableString *mrlString = [NSMutableString stringWithUTF8String: psz_uri ];
NSMutableString *mrlString = [NSMutableString stringWithUTF8String:psz_uri];
NSRange offile = [mrlString rangeOfString:@"file"];
free(psz_uri);
......
......@@ -219,14 +219,14 @@
/* fill uri info */
char *psz_url = decode_URI(input_item_GetURI(p_item));
[_uriTextField setStringValue: [NSString stringWithUTF8String:psz_url ? psz_url : ""]];
[_uriTextField setStringValue:toNSStr(psz_url)];
free(psz_url);
/* fill title info */
char *psz_title = input_item_GetTitle(p_item);
if (!psz_title)
psz_title = input_item_GetName(p_item);
[_titleTextField setStringValue: [NSString stringWithUTF8String:psz_title ? : ""]];
[_titleTextField setStringValue:toNSStr(psz_title)];
free(psz_title);
#define SET( foo, bar ) \
......@@ -255,7 +255,7 @@
/* FIXME Can also be attachment:// */
if (psz_meta && strncmp(psz_meta, "attachment://", 13))
image = [[NSImage alloc] initWithContentsOfURL: [NSURL URLWithString:[NSString stringWithUTF8String:psz_meta]]];
image = [[NSImage alloc] initWithContentsOfURL: [NSURL URLWithString:toNSStr(psz_meta)]];
else
image = [NSImage imageNamed: @"noart.png"];
[_imageWell setImage: image];
......@@ -275,7 +275,7 @@
- (void)setMeta: (char *)psz_meta forLabel: (id)theItem
{
if (psz_meta != NULL && *psz_meta)
[theItem setStringValue: [NSString stringWithUTF8String:psz_meta]];
[theItem setStringValue: toNSStr(psz_meta)];
else
[theItem setStringValue: @""];
}
......@@ -472,11 +472,7 @@ error:
if (i_object_id == -1) {
vlc_mutex_lock(&p_item->lock);
for (int i = 0 ; i < p_item->i_categories ; i++) {
NSString *name;
if (p_item->pp_categories[i]->psz_name)
name = [NSString stringWithUTF8String:p_item->pp_categories[i]->psz_name];
else
name = @"";
NSString *name = toNSStr(p_item->pp_categories[i]->psz_name);
VLCInfoTreeItem *item = [[VLCInfoTreeItem alloc]
initWithName:name
value:@""
......@@ -491,16 +487,8 @@ error:
vlc_mutex_lock(&p_item->lock);
info_category_t *cat = p_item->pp_categories[i_object_id];
for (int i = 0 ; i < cat->i_infos ; i++) {
NSString *name;
NSString *value;
if (cat->pp_infos[i]->psz_name != NULL)
name = [NSString stringWithUTF8String:cat->pp_infos[i]->psz_name];
else
name = @"";
if (cat->pp_infos[i]->psz_value != NULL)
value = [NSString stringWithUTF8String:cat->pp_infos[i]->psz_value];
else
value = @"";
NSString *name = toNSStr(cat->pp_infos[i]->psz_name);
NSString *value = toNSStr(cat->pp_infos[i]->psz_value);
VLCInfoTreeItem *item = [[VLCInfoTreeItem alloc]
initWithName:name
value:value
......
This diff is collapsed.
......@@ -539,7 +539,7 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
- (void)setupField:(NSTextField *)object forOption:(const char *)psz_option
{
char *psz_tmp = config_GetPsz(p_intf, psz_option);
[object setStringValue: [NSString stringWithUTF8String:psz_tmp ?: ""]];
[object setStringValue: toNSStr(psz_tmp)];
[object setToolTip: _NS(config_GetLabel(p_intf, psz_option))];
free(psz_tmp);
}
......@@ -557,7 +557,7 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
const char *pref = NULL;
pref = [[[NSUserDefaults standardUserDefaults] objectForKey:@"language"] UTF8String];
for (int x = 0; ppsz_language[x] != NULL; x++) {
[_intf_languagePopup addItemWithTitle:[NSString stringWithUTF8String:ppsz_language_text[x]]];
[_intf_languagePopup addItemWithTitle:toNSStr(ppsz_language_text[x])];
if (pref) {
if (!strcmp(ppsz_language[x], pref))
sel = x;
......@@ -777,9 +777,9 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
&& !strncmp(p_item->psz_name , "key-", 4)
&& !EMPTY_STR(p_item->psz_text)) {
[tempArray_desc addObject: _NS(p_item->psz_text)];
[tempArray_names addObject: [NSString stringWithUTF8String:p_item->psz_name]];
[tempArray_names addObject: toNSStr(p_item->psz_name)];
if (p_item->value.psz)
[_hotkeySettings addObject: [NSString stringWithUTF8String:p_item->value.psz]];
[_hotkeySettings addObject: toNSStr(p_item->value.psz)];
else
[_hotkeySettings addObject: [NSString string]];
}
......@@ -907,7 +907,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
if (_intfSettingChanged) {
NSUInteger index = [_intf_languagePopup indexOfSelectedItem];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:[NSString stringWithUTF8String:ppsz_language[index]] forKey:@"language"];
[defaults setObject:toNSStr(ppsz_language[index]) forKey:@"language"];
[defaults synchronize];
config_PutInt(p_intf, "metadata-network-access", [_intf_artCheckbox state]);
......@@ -1252,7 +1252,7 @@ static inline void save_string_list(intf_thread_t * p_intf, id object, const cha
- (IBAction)showFontPicker:(id)sender
{
char * font = config_GetPsz(p_intf, "freetype-font");
NSString * fontName = font ? [NSString stringWithUTF8String:font] : nil;
NSString * fontName = font ? toNSStr(font) : nil;
free(font);
if (fontName) {
NSFont * font = [NSFont fontWithName:fontName size:0.0];
......
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