From: Mitchell Livingston Date: Mon, 26 Dec 2011 02:46:27 +0000 (+0000) Subject: If we have a url and string in the clipboard, only use the url when trying to open... X-Git-Tag: 2.50b1~102 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=22a5e885ba51961e0913f253d36976f9b3f96945;p=transmission 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 --- diff --git a/macosx/TorrentTableView.m b/macosx/TorrentTableView.m index 02d416b70..64fa49240 100644 --- a/macosx/TorrentTableView.m +++ b/macosx/TorrentTableView.m @@ -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]]; - } } } }