]> git.sesse.net Git - vlc/commitdiff
* fix compilation warnings by adding _defaultTableHeader*SortImage to NSOutlineView...
authorFelix Paul Kühne <fkuehne@videolan.org>
Sun, 6 Aug 2006 16:10:19 +0000 (16:10 +0000)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sun, 6 Aug 2006 16:10:19 +0000 (16:10 +0000)
modules/gui/macosx/playlist.m

index bc315e084f4a3e1d669b99bad82e8603c08fd55f..96dcc9e5f0067d824d7b43f2e6272db66be1cacb 100644 (file)
@@ -323,6 +323,19 @@ NSLog( @"expandable" );
 
 @end
 
+/*****************************************************************************
+ * extension to NSOutlineView's interface to fix compilation warnings
+ * and let us access these 2 functions properly
+ * this uses a private Apple-API, but works fine on all current OSX releases
+ * keep checking for compatiblity with future releases though
+ *****************************************************************************/
+
+@interface NSOutlineView (UndocumentedSortImages)
++ (NSImage *)_defaultTableHeaderSortImage;
++ (NSImage *)_defaultTableHeaderReverseSortImage;
+@end
+
+
 /*****************************************************************************
  * VLCPlaylist implementation
  *****************************************************************************/
@@ -357,26 +370,11 @@ NSLog( @"expandable" );
         @"VLCPlaylistItemPboardType", nil]];
     [o_outline_view setIntercellSpacing: NSMakeSize (0.0, 1.0)];
 
-/* We need to check whether _defaultTableHeaderSortImage exists, since it 
-belongs to an Apple hidden private API, and then can "disapear" at any time*/
-
-    if( [[NSOutlineView class] respondsToSelector:@selector(_defaultTableHeaderSortImage)] )
-    {
-        o_ascendingSortingImage = [[NSOutlineView class] _defaultTableHeaderSortImage];
-    }
-    else
-    {
-        o_ascendingSortingImage = nil;
-    }
-
-    if( [[NSOutlineView class] respondsToSelector:@selector(_defaultTableHeaderReverseSortImage)] )
-    {
-        o_descendingSortingImage = [[NSOutlineView class] _defaultTableHeaderReverseSortImage];
-    }
-    else
-    {
-        o_descendingSortingImage = nil;
-    }
+    /* this uses private Apple API which works fine until 10.4, 
+     * but keep checking in the future!
+     * These methods are being added artificially to NSOutlineView's interface above */
+    o_ascendingSortingImage = [[NSOutlineView class] _defaultTableHeaderSortImage];
+    o_descendingSortingImage = [[NSOutlineView class] _defaultTableHeaderReverseSortImage];
 
     o_tc_sortColumn = nil;