diff --git a/macosx/Controller.m b/macosx/Controller.m index e0e28ad53..394c4c268 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -650,17 +650,8 @@ static void sleepCallBack( void * controller, io_service_t y, (id ) info row: (int) row dropOperation: (NSTableViewDropOperation) operation { - NSPasteboard * pasteboard; - - pasteboard = [info draggingPasteboard]; - if( ![[pasteboard types] containsObject: NSFilenamesPboardType] ) - { - return NO; - } - - [self application: NSApp openFiles: - [pasteboard propertyListForType: NSFilenamesPboardType]]; - + [self application: NSApp openFiles: [[info draggingPasteboard] + propertyListForType: NSFilenamesPboardType]]; return YES; } @@ -668,6 +659,15 @@ static void sleepCallBack( void * controller, io_service_t y, (id ) info proposedRow: (int) row proposedDropOperation: (NSTableViewDropOperation) operation { + NSPasteboard * pasteboard = [info draggingPasteboard]; + + if (![[pasteboard types] containsObject: NSFilenamesPboardType] + || [[[pasteboard propertyListForType: NSFilenamesPboardType] + pathsMatchingExtensions: [NSArray arrayWithObject: @"torrent"]] + count] == 0) + return NSDragOperationNone; + + [fTableView setDropRow: fCount dropOperation: NSTableViewDropAbove]; return NSDragOperationGeneric; }