refactor copyMagnetLinks (#3086)

This commit is contained in:
Antoine Cœur
2022-05-17 01:08:20 +08:00
committed by GitHub
parent e286e45ac8
commit e23a4b3589
2 changed files with 2 additions and 18 deletions

View File

@@ -2032,24 +2032,7 @@ static void removeKeRangerRansomware()
- (void)copyMagnetLinks:(id)sender
{
NSArray* torrents = self.fTableView.selectedTorrents;
if (torrents.count <= 0)
{
return;
}
NSMutableArray* links = [NSMutableArray arrayWithCapacity:torrents.count];
for (Torrent* torrent in torrents)
{
[links addObject:torrent.magnetLink];
}
NSString* text = [links componentsJoinedByString:@"\n"];
NSPasteboard* pb = NSPasteboard.generalPasteboard;
[pb clearContents];
[pb writeObjects:@[ text ]];
[self.fTableView copy:sender];
}
- (void)revealFile:(id)sender