From 662ceeebb8b5a704b707b6b8d85e5de1738e29b0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <felix@feepk.net>
Date: Fri, 24 Jan 2020 18:00:32 +0100
Subject: [PATCH] macosx/prefs widgets: replace delegate method deprecated in
 Mac OS 10.4

---
 modules/gui/macosx/preferences/prefs_widgets.m | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/modules/gui/macosx/preferences/prefs_widgets.m b/modules/gui/macosx/preferences/prefs_widgets.m
index a7b52ca94fa7..3ee0e77048db 100644
--- a/modules/gui/macosx/preferences/prefs_widgets.m
+++ b/modules/gui/macosx/preferences/prefs_widgets.m
@@ -2139,19 +2139,10 @@ o_moduleenabled = [NSNumber numberWithBool:NO];\
 
 @implementation ModuleListConfigControl (NSTableDataSource)
 
-- (BOOL)tableView:(NSTableView*)table writeRows:(NSArray*)rows
-     toPasteboard:(NSPasteboard*)pb
-{
-    // We only want to allow dragging of selected rows.
-    NSEnumerator    *iter = [rows objectEnumerator];
-    NSNumber        *row;
-    while ((row = [iter nextObject]) != nil) {
-        if (![table isRowSelected:[row intValue]])
-            return NO;
-    }
-
-    [pb declareTypes:[NSArray arrayWithObject:@"VLC media player module"] owner:nil];
-    [pb setPropertyList:rows forType:@"VLC media player module"];
+- (BOOL)tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard
+{
+    [pboard declareTypes:@[@"VLC media player module"] owner:nil];
+    [pboard setPropertyList:@[@(rowIndexes.firstIndex)] forType:@"VLC media player module"];
     return YES;
 }
 
-- 
GitLab