From 22a5e885ba51961e0913f253d36976f9b3f96945 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Mon, 26 Dec 2011 02:46:27 +0000 Subject: [PATCH] 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 --- macosx/TorrentTableView.m | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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]]; - } } } }