If we have a url and string in the clipboard, only use the url when trying to open as a torrent file. This way we avoid opening the same URL twice

This commit is contained in:
Mitchell Livingston 2011-12-26 02:46:27 +00:00
parent 5339d25dca
commit 22a5e885ba
1 changed files with 1 additions and 4 deletions

View File

@ -545,8 +545,7 @@
NSURL * url;
if ((url = [NSURL URLFromPasteboard: [NSPasteboard generalPasteboard]]))
[fController openURL: [url absoluteString]];
if ([NSApp isOnLionOrBetter])
else if ([NSApp isOnLionOrBetter])
{
NSArray * items = [[NSPasteboard generalPasteboard] readObjectsForClasses: [NSArray arrayWithObject: [NSString class]] options: nil];
if (items)
@ -555,9 +554,7 @@
for (NSString * pbItem in items)
{
for (NSTextCheckingResult * result in [detector matchesInString: pbItem options: 0 range: NSMakeRange(0, [pbItem length])])
{
[fController openURL: [[result URL] absoluteString]];
}
}
}
}