1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 01:27:28 +00:00

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

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]];
}
}
}
}