Ignore:
Timestamp:
Feb 13, 2011, 2:02:13 AM (11 years ago)
Author:
livings124
Message:

Add option to remove completed transfers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r11872 r11884  
    13251325{
    13261326    [torrents retain];
    1327     NSInteger active = 0, downloading = 0;
    13281327
    13291328    if ([fDefaults boolForKey: @"CheckRemove"])
    13301329    {
     1330        NSInteger active = 0, downloading = 0;
    13311331        for (Torrent * torrent in torrents)
    13321332            if ([torrent isActive])
     
    14341434    }
    14351435   
     1436    #warning why do we need them retained?
    14361437    [torrents release];
    14371438   
     
    14491450{
    14501451    [self removeTorrents: [fTableView selectedTorrents] deleteData: YES];
     1452}
     1453
     1454- (void) clearCompleted: (id) sender
     1455{
     1456    NSMutableArray * torrents = [[NSMutableArray alloc] init];
     1457   
     1458    for (Torrent * torrent in fTorrents)
     1459        if ([torrent isFinishedSeeding])
     1460            [torrents addObject: torrent];
     1461   
     1462    [self confirmRemoveTorrents: torrents deleteData: NO];
    14511463}
    14521464
     
    39033915        return canUseTable && [fTableView numberOfSelectedRows] > 0;
    39043916    }
     3917   
     3918    //clear completed transfers item
     3919    if (action == @selector(clearCompleted:))
     3920    {
     3921        for (Torrent * torrent in fTorrents)
     3922            if ([torrent isFinishedSeeding])
     3923                return YES;
     3924        return NO;
     3925    }
    39053926
    39063927    //enable pause all item
Note: See TracChangeset for help on using the changeset viewer.