Ignore:
Timestamp:
Oct 1, 2009, 2:24:58 AM (13 years ago)
Author:
livings124
Message:

allowing pasting into the tracker table on 10.5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TrackerTableView.m

    r9227 r9228  
    8080- (void) paste: (id) sender
    8181{
    82     if (!fTorrent)
    83         return;
     82    NSAssert(fTorrent != nil, @"no torrent but trying to paste; should not be able to call this method");
     83   
     84    BOOL added = NO;
    8485   
    8586    if ([NSApp isOnSnowLeopardOrBetter])
     
    8990        NSAssert(items != nil, @"no string items to paste; should not be able to call this method");
    9091       
    91         BOOL added = NO;
    9292        for (NSString * pbItem in items)
    9393        {
     
    9696                    added = YES;
    9797        }
    98        
    99         //none added
    100         if (!added)
    101             NSBeep();
    102     }
     98    }
     99    else
     100    {
     101        NSString * pbItem =[[NSPasteboard generalPasteboard] stringForType: NSStringPboardType];
     102        NSAssert(pbItem != nil, @"no string items to paste; should not be able to call this method");
     103       
     104        for (NSString * item in [pbItem componentsSeparatedByString: @"\n"])
     105            if ([fTorrent addTrackerToNewTier: item])
     106                added = YES;
     107    }
     108   
     109    //none added
     110    if (!added)
     111        NSBeep();
    103112}
    104113
     
    111120   
    112121    if (action == @selector(paste:))
    113         return [[NSPasteboard generalPasteboard] canReadObjectForClasses: [NSArray arrayWithObject: [NSString class]] options: nil];
     122    {
     123        return fTorrent && ([NSApp isOnSnowLeopardOrBetter]
     124                ? [[NSPasteboard generalPasteboard] canReadObjectForClasses: [NSArray arrayWithObject: [NSString class]] options: nil]
     125                : [[NSPasteboard generalPasteboard] availableTypeFromArray: [NSArray arrayWithObject: NSStringPboardType]] != nil);
     126    }
    114127   
    115128    return YES;
Note: See TracChangeset for help on using the changeset viewer.