Ignore:
Timestamp:
Feb 7, 2010, 1:51:45 AM (13 years ago)
Author:
livings124
Message:

retrieve peers and webseeds in a single loop

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.m

    r10113 r10125  
    12661266           
    12671267            [fTrackerTable setTrackers: nil];
     1268            [fTrackerTable deselectAll: self];
    12681269            [fTrackerTable reloadData];
    12691270        }
     
    15551556        [fPeers removeAllObjects];
    15561557   
     1558    if (!fWebSeeds)
     1559        fWebSeeds = [[NSMutableArray alloc] init];
     1560    else
     1561        [fWebSeeds removeAllObjects];
     1562   
    15571563    NSUInteger known = 0, connected = 0, tracker = 0, incoming = 0, cache = 0, pex = 0, dht = 0, ltep = 0,
    15581564                toUs = 0, fromUs = 0;
     
    15611567    {
    15621568        [fPeers addObjectsFromArray: [torrent peers]];
     1569        [fWebSeeds addObjectsFromArray: [torrent webSeeds]];
    15631570       
    15641571        known += [torrent totalPeersKnown];
     
    15831590        }
    15841591    }
     1592   
     1593    [fPeers sortUsingDescriptors: [self peerSortDescriptors]];
     1594    [fPeerTable reloadData];
     1595   
     1596    [fWebSeeds sortUsingDescriptors: [fWebSeedTable sortDescriptors]];
     1597    [fWebSeedTable reloadData];
    15851598   
    15861599    NSString * knownString = [NSString stringWithFormat: NSLocalizedString(@"%d known", "Inspector -> Peers tab -> peers"), known];
     
    16401653        [fConnectedPeersField setStringValue: connectedText];
    16411654    }
    1642    
    1643     [fPeers sortUsingDescriptors: [self peerSortDescriptors]];
    1644     [fPeerTable reloadData];
    1645    
    1646     if (!fWebSeeds)
    1647         fWebSeeds = [[NSMutableArray alloc] init];
    1648     else
    1649         [fWebSeeds removeAllObjects];
    1650    
    1651     for (Torrent * torrent in fTorrents)
    1652         [fWebSeeds addObjectsFromArray: [torrent webSeeds]];
    1653    
    1654     [fWebSeeds sortUsingDescriptors: [fWebSeedTable sortDescriptors]];
    1655     [fWebSeedTable reloadData];
    16561655}
    16571656
Note: See TracChangeset for help on using the changeset viewer.