Changeset 764 for trunk/macosx


Ignore:
Timestamp:
Aug 13, 2006, 7:43:15 PM (16 years ago)
Author:
livings124
Message:

Some changes to getting peers in libtransmission. Now it uses a separate structure for the GUI accessing peers.

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r761 r764  
    518518- (NSArray *) peers
    519519{
    520     tr_peer_t * peer;
    521520    int totalPeers = [self totalPeers], i;
     521    tr_peer_stat_t peer;
    522522   
    523523    NSMutableArray * peers = [NSMutableArray arrayWithCapacity: totalPeers];
    524524    for (i = 0; i < totalPeers; i++)
    525525    {
    526         peer = tr_getPeer(fHandle, i);
     526        peer = fStat->peers[i];
     527   
    527528        [peers addObject: [NSDictionary dictionaryWithObjectsAndKeys:
    528             [NSString stringWithCString: (char *) tr_clientForId(tr_peerId(peer)) encoding: NSUTF8StringEncoding],
     529            [NSString stringWithCString: (char *) peer.client encoding: NSUTF8StringEncoding],
    529530                @"Client",
    530             [NSNumber numberWithBool: tr_peerIsDownloading(peer)], @"UL To",
    531             [NSNumber numberWithBool: tr_peerIsUploading(peer)], @"DL From", nil]];
    532     }
     531            [NSNumber numberWithBool: peer.isDownloading], @"UL To",
     532            [NSNumber numberWithBool: peer.isUploading], @"DL From", nil]];
     533        /*[peers addObject: [NSDictionary dictionaryWithObjectsAndKeys:
     534            @"Client", @"Client",
     535            [NSNumber numberWithBool: YES], @"UL To",
     536            [NSNumber numberWithBool: YES], @"DL From", nil]];*/
     537    }
     538    //NSLog(@"%d", tr_peerId(peer));
    533539   
    534540    return peers;
Note: See TracChangeset for help on using the changeset viewer.