Changeset 13117


Ignore:
Timestamp:
Dec 26, 2011, 2:39:30 AM (9 years ago)
Author:
livings124
Message:

run on Snow Leopard again

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/NSApplicationAdditions.h

    r12940 r13117  
    2424
    2525#define NSPopoverLion NSClassFromString(@"NSPopover")
     26#define NSDataDetectorLion NSClassFromString(@"NSDataDetector")
    2627
    2728@interface NSApplication (NSApplicationAdditions)
  • trunk/macosx/TorrentTableView.m

    r13116 r13117  
    552552        if (items)
    553553        {
    554             NSDataDetector * detector = [NSDataDetector dataDetectorWithTypes: NSTextCheckingTypeLink error: nil];
     554            NSDataDetector * detector = [NSDataDetectorLion dataDetectorWithTypes: NSTextCheckingTypeLink error: nil];
    555555            for (NSString * pbItem in items)
    556556            {
     
    573573            return YES;
    574574       
    575         NSArray * items = [[NSPasteboard generalPasteboard] readObjectsForClasses: [NSArray arrayWithObject: [NSString class]] options: nil];
    576         if (items)
    577         {
    578             NSDataDetector * detector = [NSDataDetector dataDetectorWithTypes: NSTextCheckingTypeLink error: nil];
    579             for (NSString * pbItem in items)
     575        if ([NSApp isOnLionOrBetter])
     576        {
     577            NSArray * items = [[NSPasteboard generalPasteboard] readObjectsForClasses: [NSArray arrayWithObject: [NSString class]] options: nil];
     578            if (items)
    580579            {
    581                 if ([detector firstMatchInString: pbItem options: 0 range: NSMakeRange(0, [pbItem length])])
    582                     return YES;
     580                NSDataDetector * detector = [NSDataDetectorLion dataDetectorWithTypes: NSTextCheckingTypeLink error: nil];
     581                for (NSString * pbItem in items)
     582                {
     583                    if ([detector firstMatchInString: pbItem options: 0 range: NSMakeRange(0, [pbItem length])])
     584                        return YES;
     585                }
    583586            }
    584587        }
Note: See TracChangeset for help on using the changeset viewer.