Reject dropped files which aren't .torrent files.
"Retarget" the drop at the bottom of the list.
This commit is contained in:
parent
4f86bbcea3
commit
6ddb247689
|
@ -650,17 +650,8 @@ static void sleepCallBack( void * controller, io_service_t y,
|
||||||
(id <NSDraggingInfo>) info row: (int) row dropOperation:
|
(id <NSDraggingInfo>) info row: (int) row dropOperation:
|
||||||
(NSTableViewDropOperation) operation
|
(NSTableViewDropOperation) operation
|
||||||
{
|
{
|
||||||
NSPasteboard * pasteboard;
|
[self application: NSApp openFiles: [[info draggingPasteboard]
|
||||||
|
propertyListForType: NSFilenamesPboardType]];
|
||||||
pasteboard = [info draggingPasteboard];
|
|
||||||
if( ![[pasteboard types] containsObject: NSFilenamesPboardType] )
|
|
||||||
{
|
|
||||||
return NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
[self application: NSApp openFiles:
|
|
||||||
[pasteboard propertyListForType: NSFilenamesPboardType]];
|
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -668,6 +659,15 @@ static void sleepCallBack( void * controller, io_service_t y,
|
||||||
(id <NSDraggingInfo>) info proposedRow: (int) row
|
(id <NSDraggingInfo>) info proposedRow: (int) row
|
||||||
proposedDropOperation: (NSTableViewDropOperation) operation
|
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;
|
return NSDragOperationGeneric;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue