refactor copyMagnetLinks (#3086)
This commit is contained in:
parent
e286e45ac8
commit
e23a4b3589
|
@ -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
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
- (NSRect)iconRectForRow:(NSInteger)row;
|
||||
|
||||
- (void)copy:(id)sender;
|
||||
- (void)paste:(id)sender;
|
||||
|
||||
- (void)toggleControlForTorrent:(Torrent*)torrent;
|
||||
|
|
Loading…
Reference in New Issue