[vlc-devel] [VLC 3.x 04/11] macosx: Remove private API for sort indicator images

Marvin Scholz epirat07 at gmail.com
Wed Aug 26 00:50:10 CEST 2020


These "magic" strings are documented in the official documentation
and exist since a long long time, Apple can't ever change those
without breaking a number of apps, so using them seems better than
relying on private API.

(cherry picked from commit 91dde5a9f4d6bbd658590984243365e9e94c7fc5)
Signed-off-by: Marvin Scholz <epirat07 at gmail.com>
---
 modules/gui/macosx/VLCPlaylist.m | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/modules/gui/macosx/VLCPlaylist.m b/modules/gui/macosx/VLCPlaylist.m
index 0f9d00c46d..22759d2d87 100644
--- a/modules/gui/macosx/VLCPlaylist.m
+++ b/modules/gui/macosx/VLCPlaylist.m
@@ -52,19 +52,6 @@
 #import <vlc_interface.h>
 #include <vlc_url.h>
 
-/*****************************************************************************
- * An extension to NSOutlineView's interface to fix compilation warnings
- * and let us access these 2 functions properly.
- * This uses a private API, but works fine on all current OSX releases.
- * Radar ID 11739459 request a public API for this. However, it is probably
- * easier and faster to recreate similar looking bitmaps ourselves.
- *****************************************************************************/
-
- at interface NSOutlineView (UndocumentedSortImages)
-+ (NSImage *)_defaultTableHeaderSortImage;
-+ (NSImage *)_defaultTableHeaderReverseSortImage;
- at end
-
 @interface VLCPlaylist ()
 {
     NSImage *_descendingSortingImage;
@@ -93,11 +80,8 @@ - (id)init
 {
     self = [super init];
     if (self) {
-        /* This uses a private API, but works fine on all current OSX releases.
-         * Radar ID 11739459 request a public API for this. However, it is probably
-         * easier and faster to recreate similar looking bitmaps ourselves. */
-        _ascendingSortingImage = [[NSOutlineView class] _defaultTableHeaderSortImage];
-        _descendingSortingImage = [[NSOutlineView class] _defaultTableHeaderReverseSortImage];
+        _ascendingSortingImage = [NSImage imageNamed:@"NSAscendingSortIndicator"];
+        _descendingSortingImage = [NSImage imageNamed:@"NSDescendingSortIndicator"];
 
         [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(applicationWillTerminate:) name: NSApplicationWillTerminateNotification object: nil];
 
-- 
2.24.3 (Apple Git-128)



More information about the vlc-devel mailing list