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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

View File

@ -29,6 +29,7 @@
- (NSRect)iconRectForRow:(NSInteger)row;
- (void)copy:(id)sender;
- (void)paste:(id)sender;
- (void)toggleControlForTorrent:(Torrent*)torrent;