mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
run on Snow Leopard again
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
*****************************************************************************/
|
||||
|
||||
#define NSPopoverLion NSClassFromString(@"NSPopover")
|
||||
#define NSDataDetectorLion NSClassFromString(@"NSDataDetector")
|
||||
|
||||
@interface NSApplication (NSApplicationAdditions)
|
||||
|
||||
|
||||
@@ -551,7 +551,7 @@
|
||||
NSArray * items = [[NSPasteboard generalPasteboard] readObjectsForClasses: [NSArray arrayWithObject: [NSString class]] options: nil];
|
||||
if (items)
|
||||
{
|
||||
NSDataDetector * detector = [NSDataDetector dataDetectorWithTypes: NSTextCheckingTypeLink error: nil];
|
||||
NSDataDetector * detector = [NSDataDetectorLion dataDetectorWithTypes: NSTextCheckingTypeLink error: nil];
|
||||
for (NSString * pbItem in items)
|
||||
{
|
||||
for (NSTextCheckingResult * result in [detector matchesInString: pbItem options: 0 range: NSMakeRange(0, [pbItem length])])
|
||||
@@ -572,14 +572,17 @@
|
||||
if ([[[NSPasteboard generalPasteboard] types] containsObject: NSURLPboardType])
|
||||
return YES;
|
||||
|
||||
NSArray * items = [[NSPasteboard generalPasteboard] readObjectsForClasses: [NSArray arrayWithObject: [NSString class]] options: nil];
|
||||
if (items)
|
||||
if ([NSApp isOnLionOrBetter])
|
||||
{
|
||||
NSDataDetector * detector = [NSDataDetector dataDetectorWithTypes: NSTextCheckingTypeLink error: nil];
|
||||
for (NSString * pbItem in items)
|
||||
NSArray * items = [[NSPasteboard generalPasteboard] readObjectsForClasses: [NSArray arrayWithObject: [NSString class]] options: nil];
|
||||
if (items)
|
||||
{
|
||||
if ([detector firstMatchInString: pbItem options: 0 range: NSMakeRange(0, [pbItem length])])
|
||||
return YES;
|
||||
NSDataDetector * detector = [NSDataDetectorLion dataDetectorWithTypes: NSTextCheckingTypeLink error: nil];
|
||||
for (NSString * pbItem in items)
|
||||
{
|
||||
if ([detector firstMatchInString: pbItem options: 0 range: NSMakeRange(0, [pbItem length])])
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user