]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/simple_prefs.m
vlc.desktop: add missing --started-from-file option (fixes #8839)
[vlc] / modules / gui / macosx / simple_prefs.m
index e2eea88b4c483ea4e9d6eccab779e5f9daa0d1f5..74fb025725358ac5e9c2304184fd657b35b2e8af 100644 (file)
@@ -330,10 +330,10 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
             continue;
         }
         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
             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]];
         if (p_item->value.psz && !strcmp(p_item->value.psz, p_item->list.psz[i]))
             [object selectItem:[object lastItem]];
@@ -359,7 +359,7 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
             mi = [[NSMenuItem alloc] initWithTitle: [NSString stringWithFormat: @"%d", p_item->list.i[i]] action:NULL keyEquivalent: @""];
         else
             msg_Err(p_intf, "item %d of pref %s failed to be created", i, name);
-        [mi setRepresentedObject:[NSNumber numberWithInt: p_item->list.i[i]]];
+        [mi setRepresentedObject:@(p_item->list.i[i])];
         [[object menu] addItem: [mi autorelease]];
         if (p_item->value.i == p_item->list.i[i])
             [object selectItem:[object lastItem]];
@@ -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++) {
         p_parser = p_list[i_index];
         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)))
                 [object selectItem: [object lastItem]];
         }
@@ -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
 {
     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))];
     free(psz_tmp);
 }
@@ -527,11 +527,11 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
     [o_video_device_pop addItemWithTitle: _NS("Default")];
     [[o_video_device_pop lastItem] setTag: 0];
     while (i < y) {
-        NSRect s_rect = [[[NSScreen screens] objectAtIndex: i] frame];
+        NSRect s_rect = [[[NSScreen screens] objectAtIndex:i] frame];
         [o_video_device_pop addItemWithTitle:
          [NSString stringWithFormat: @"%@ %i (%ix%i)", _NS("Screen"), i+1,
                    (int)s_rect.size.width, (int)s_rect.size.height]];
-        [[o_video_device_pop lastItem] setTag: (int)[[[NSScreen screens] objectAtIndex: i] displayID]];
+        [[o_video_device_pop lastItem] setTag: (int)[[[NSScreen screens] objectAtIndex:i] displayID]];
         i++;
     }
     [o_video_device_pop selectItemAtIndex: 0];
@@ -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)
            && !EMPTY_STR(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)
-                [o_hotkeySettings addObject: [NSString stringWithUTF8String:p_item->value.psz]];
+                [o_hotkeySettings addObject: @(p_item->value.psz)];
             else
                 [o_hotkeySettings addObject: [NSString string]];
         }
@@ -1114,7 +1114,7 @@ static inline void save_module_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 ? @(font) : nil;
     free(font);
     if (fontName) {
         NSFont * font = [NSFont fontWithName:fontName size:0.0];
@@ -1264,8 +1264,8 @@ static inline void save_module_list(intf_thread_t * p_intf, id object, const cha
 {
     if (sender == o_hotkeys_change_btn || sender == o_hotkeys_listbox) {
         [o_hotkeys_change_lbl setStringValue: [NSString stringWithFormat: _NS("Press new keys for\n\"%@\""),
-                                               [o_hotkeyDescriptions objectAtIndex: [o_hotkeys_listbox selectedRow]]]];
-        [o_hotkeys_change_keys_lbl setStringValue: [[VLCStringUtility sharedInstance] OSXStringKeyToString:[o_hotkeySettings objectAtIndex: [o_hotkeys_listbox selectedRow]]]];
+                                               [o_hotkeyDescriptions objectAtIndex:[o_hotkeys_listbox selectedRow]]]];
+        [o_hotkeys_change_keys_lbl setStringValue: [[VLCStringUtility sharedInstance] OSXStringKeyToString:[o_hotkeySettings objectAtIndex:[o_hotkeys_listbox selectedRow]]]];
         [o_hotkeys_change_taken_lbl setStringValue: @""];
         [o_hotkeys_change_win setInitialFirstResponder: [o_hotkeys_change_win contentView]];
         [o_hotkeys_change_win makeFirstResponder: [o_hotkeys_change_win contentView]];
@@ -1325,9 +1325,9 @@ static inline void save_module_list(intf_thread_t * p_intf, id object, const cha
     NSString * identifier = [aTableColumn identifier];
 
     if ([identifier isEqualToString: @"action"])
-        return [o_hotkeyDescriptions objectAtIndex: rowIndex];
+        return [o_hotkeyDescriptions objectAtIndex:rowIndex];
     else if ([identifier isEqualToString: @"shortcut"])
-        return [[VLCStringUtility sharedInstance] OSXStringKeyToString:[o_hotkeySettings objectAtIndex: rowIndex]];
+        return [[VLCStringUtility sharedInstance] OSXStringKeyToString:[o_hotkeySettings objectAtIndex:rowIndex]];
     else {
         msg_Err(p_intf, "unknown TableColumn identifier (%s)!", [identifier UTF8String]);
         return NULL;
@@ -1352,11 +1352,11 @@ static inline void save_module_list(intf_thread_t * p_intf, id object, const cha
         if (i_returnValue != NSNotFound)
             [o_hotkeys_change_taken_lbl setStringValue: [NSString stringWithFormat:
                                                          _NS("This combination is already taken by \"%@\"."),
-                                                         [o_hotkeyDescriptions objectAtIndex: i_returnValue]]];
+                                                         [o_hotkeyDescriptions objectAtIndex:i_returnValue]]];
         else if (i_returnValue2 != NSNotFound)
             [o_hotkeys_change_taken_lbl setStringValue: [NSString stringWithFormat:
                                                          _NS("This combination is already taken by \"%@\"."),
-                                                         [o_hotkeyDescriptions objectAtIndex: i_returnValue2]]];
+                                                         [o_hotkeyDescriptions objectAtIndex:i_returnValue2]]];
         else
             [o_hotkeys_change_taken_lbl setStringValue: @""];