Changeset 124


Ignore:
Timestamp:
Feb 10, 2006, 8:46:44 PM (16 years ago)
Author:
titer
Message:

Reject dropped files which aren't .torrent files.
"Retarget" the drop at the bottom of the list.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r123 r124  
    651651    (NSTableViewDropOperation) operation
    652652{
    653     NSPasteboard * pasteboard;
    654 
    655     pasteboard = [info draggingPasteboard];
    656     if( ![[pasteboard types] containsObject: NSFilenamesPboardType] )
    657     {
    658         return NO;
    659     }
    660 
    661     [self application: NSApp openFiles:
    662         [pasteboard propertyListForType: NSFilenamesPboardType]];
    663 
     653    [self application: NSApp openFiles: [[info draggingPasteboard]
     654        propertyListForType: NSFilenamesPboardType]];
    664655    return YES;
    665656}
     
    669660    proposedDropOperation: (NSTableViewDropOperation) operation
    670661{
     662    NSPasteboard * pasteboard = [info draggingPasteboard];
     663
     664    if (![[pasteboard types] containsObject: NSFilenamesPboardType]
     665            || [[[pasteboard propertyListForType: NSFilenamesPboardType]
     666                pathsMatchingExtensions: [NSArray arrayWithObject: @"torrent"]]
     667                count] == 0)
     668        return NSDragOperationNone;
     669
     670    [fTableView setDropRow: fCount dropOperation: NSTableViewDropAbove];
    671671    return NSDragOperationGeneric;
    672672}
Note: See TracChangeset for help on using the changeset viewer.