[vlc-commits] macosx: Remove private API for sort indicator images
Marvin Scholz
git at videolan.org
Wed Aug 26 16:28:21 CEST 2020
vlc/vlc-3.0 | branch: master | Marvin Scholz <epirat07 at gmail.com> | Sat Aug 18 01:31:59 2018 +0200| [300157024bc9679d14da650d82ed9786238f364d] | committer: Marvin Scholz
macosx: Remove private API for sort indicator images
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>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=300157024bc9679d14da650d82ed9786238f364d
---
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 @@
{
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];
More information about the vlc-commits
mailing list