[vlc-commits] [Git][videolan/vlc][master] macosx: Use NSImageName constants instead of string literals

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Sat Jun 27 04:45:23 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
0dbd512f by Serhii Bykov at 2026-06-26T21:22:37+02:00
macosx: Use NSImageName constants instead of string literals

- - - - -


5 changed files:

- modules/gui/macosx/library/VLCLibrarySegment.m
- modules/gui/macosx/library/VLCLibraryTableCellView.m
- modules/gui/macosx/library/home-library/VLCLibraryHomeViewBaseCarouselContainerView.m
- modules/gui/macosx/library/search-library/VLCLibrarySearchProvider.m
- modules/gui/macosx/windows/VLCOpenWindowController.m


Changes:

=====================================
modules/gui/macosx/library/VLCLibrarySegment.m
=====================================
@@ -633,7 +633,7 @@ NSArray<NSString *> *defaultBookmarkedLocations()
             self.internalDisplayImage = [NSImage imageWithSystemSymbolName:@"list.triangle"
                                                   accessibilityDescription:@"Playlists icon"];
         } else {
-            self.internalDisplayImage = [NSImage imageNamed:@"NSListViewTemplate"];
+            self.internalDisplayImage = [NSImage imageNamed:NSImageNameListViewTemplate];
             self.internalDisplayImage.template = YES;
         }
         self.internalMediaLibraryRequired = YES;
@@ -682,7 +682,7 @@ NSArray<NSString *> *defaultBookmarkedLocations()
             self.internalDisplayImage = [NSImage imageWithSystemSymbolName:@"play.rectangle"
                                                   accessibilityDescription:@"Group icon"];
         } else {
-            self.internalDisplayImage = [NSImage imageNamed:@"NSTouchBarTagIcon"];
+            self.internalDisplayImage = [NSImage imageNamed:NSImageNameTouchBarTagIconTemplate];
             self.internalDisplayImage.template = YES;
         }
         self.internalMediaLibraryRequired = YES;
@@ -722,7 +722,7 @@ NSArray<NSString *> *defaultBookmarkedLocations()
             self.internalDisplayImage = [NSImage imageWithSystemSymbolName:@"rectangle.3.group"
                                                   accessibilityDescription:@"Groups icon"];
         } else {
-            self.internalDisplayImage = [NSImage imageNamed:@"NSTouchBarTagIcon"];
+            self.internalDisplayImage = [NSImage imageNamed:NSImageNameTouchBarTagIconTemplate];
             self.internalDisplayImage.template = YES;
         }
         self.internalMediaLibraryRequired = YES;
@@ -784,7 +784,7 @@ NSArray<NSString *> *defaultBookmarkedLocations()
                 [NSImage imageWithSystemSymbolName:@"folder"
                           accessibilityDescription:@"Bookmarked location icon"];
         } else {
-            self.internalDisplayImage = [NSImage imageNamed:@"NSFolder"];
+            self.internalDisplayImage = [NSImage imageNamed:NSImageNameFolder];
             self.internalDisplayImage.template = YES;
         }
         self.internalLibraryViewControllerClass = VLCLibraryGroupsViewController.class;
@@ -823,7 +823,7 @@ NSArray<NSString *> *defaultBookmarkedLocations()
             self.internalDisplayImage = [NSImage imageWithSystemSymbolName:@"folder"
                                                   accessibilityDescription:@"Browse icon"];
         } else {
-            self.internalDisplayImage = [NSImage imageNamed:@"NSFolder"];
+            self.internalDisplayImage = [NSImage imageNamed:NSImageNameFolder];
             self.internalDisplayImage.template = YES;
         }
         self.internalLibraryViewControllerClass = VLCLibraryMediaSourceViewController.class;
@@ -896,7 +896,7 @@ NSArray<NSString *> *defaultBookmarkedLocations()
                 [NSImage imageWithSystemSymbolName:@"antenna.radiowaves.left.and.right"
                           accessibilityDescription:@"Streams icon"];
         } else {
-            self.internalDisplayImage = [NSImage imageNamed:@"NSActionTemplate"];
+            self.internalDisplayImage = [NSImage imageNamed:NSImageNameActionTemplate];
             self.internalDisplayImage.template = YES;
         }
         self.internalLibraryViewControllerClass = VLCLibraryMediaSourceViewController.class;


=====================================
modules/gui/macosx/library/VLCLibraryTableCellView.m
=====================================
@@ -22,6 +22,7 @@
 
 #import "VLCLibraryTableCellView.h"
 
+#import "extensions/NSImage+VLCAdditions.h"
 #import "extensions/NSFont+VLCAdditions.h"
 #import "extensions/NSString+Helpers.h"
 #import "extensions/NSView+VLCAdditions.h"
@@ -151,7 +152,7 @@ NSString * const VLCLibraryTableCellViewIdentifier = @"VLCLibraryTableCellViewId
 
     self.singlePrimaryTitleTextField.hidden = NO;
     self.singlePrimaryTitleTextField.stringValue = sectionString;
-    self.representedImageView.image = [NSImage imageNamed: @"noart.png"];
+    self.representedImageView.image = NSImage.VLCNoArtImage;
 
     _representedVideoLibrarySection = section;
 }


=====================================
modules/gui/macosx/library/home-library/VLCLibraryHomeViewBaseCarouselContainerView.m
=====================================
@@ -108,7 +108,7 @@
 
     const CGFloat buttonSize = VLCLibraryUIUnits.largeSpacing;
 
-    NSImage * const leftImage = [NSImage imageNamed:@"NSGoLeftTemplate"];
+    NSImage * const leftImage = [NSImage imageNamed:NSImageNameGoLeftTemplate];
     _leftButton = [[NSButton alloc] initWithFrame:NSZeroRect];
     self.leftButton.translatesAutoresizingMaskIntoConstraints = NO;
     self.leftButton.image = leftImage;
@@ -122,7 +122,7 @@
         [self.leftButton.heightAnchor constraintEqualToConstant:buttonSize],
     ]];
 
-    NSImage * const rightImage = [NSImage imageNamed:@"NSGoRightTemplate"];
+    NSImage * const rightImage = [NSImage imageNamed:NSImageNameGoRightTemplate];
     _rightButton = [[NSButton alloc] initWithFrame:NSZeroRect];
     self.rightButton.translatesAutoresizingMaskIntoConstraints = NO;
     self.rightButton.image = rightImage;


=====================================
modules/gui/macosx/library/search-library/VLCLibrarySearchProvider.m
=====================================
@@ -150,7 +150,7 @@ FETCH_TYPED_LIST(fetchPlaylists, playlist, Playlist, vlc_ml_list_playlists(p_ml,
         [[VLCLibrarySearchProvider alloc]
             initWithDisplayTitle:_NS("Playlists")
                     displayImage:[self imageWithSymbolName:@"list.triangle"
-                                             fallbackImage:[NSImage imageNamed:@"NSListViewTemplate"]]
+                                             fallbackImage:[NSImage imageNamed:NSImageNameListViewTemplate]]
                       fetchBlock:^(const vlc_ml_query_params_t *params) {
                           return fetchPlaylists(params);
                       }],


=====================================
modules/gui/macosx/windows/VLCOpenWindowController.m
=====================================
@@ -762,7 +762,7 @@ NSString *const VLCOpenTextFieldWasClicked = @"VLCOpenTextFieldWasClicked";
     } else {
         msg_Warn(getIntf(), "unknown disk type, no idea what to display");
 
-        [self showOpticalMediaView: _discNoDiscView withIcon: [NSImage imageNamed:@"NSApplicationIcon"]];
+        [self showOpticalMediaView: _discNoDiscView withIcon: [NSImage imageNamed:NSImageNameApplicationIcon]];
     }
 }
 
@@ -875,7 +875,7 @@ NSString *const VLCOpenTextFieldWasClicked = @"VLCOpenTextFieldWasClicked";
             msg_Dbg(getIntf(), "no optical media found");
             [self->_discSelectorPopup setHidden: YES];
             [self setMRL:@""];
-            [self showOpticalMediaView: self->_discNoDiscView withIcon: [NSImage imageNamed: @"NSApplicationIcon"]];
+            [self showOpticalMediaView: self->_discNoDiscView withIcon: [NSImage imageNamed: NSImageNameApplicationIcon]];
         }
     });
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0dbd512f99929caa6d0212f827a08b328a18c29b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0dbd512f99929caa6d0212f827a08b328a18c29b
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list