Changeset 10131


Ignore:
Timestamp:
Feb 7, 2010, 5:37:01 PM (12 years ago)
Author:
livings124
Message:

a couple more tweaks to displaying peers and webseeds

Location:
trunk/macosx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/FileOutlineView.h

    r9844 r10131  
    3333    NSGradient * fHighPriorityGradient, * fLowPriorityGradient, * fMixedPriorityGradient;
    3434   
    35     int fMouseRow;
     35    NSInteger fMouseRow;
    3636}
    3737
     
    4141- (NSRect) iconRectForRow: (int) row;
    4242
    43 - (int) hoveredRow;
     43- (NSInteger) hoveredRow;
    4444
    4545@end
  • trunk/macosx/FileOutlineView.m

    r10116 r10131  
    106106- (NSMenu *) menuForEvent: (NSEvent *) event
    107107{
    108     int row = [self rowAtPoint: [self convertPoint: [event locationInWindow] fromView: nil]];
     108    const NSInteger row = [self rowAtPoint: [self convertPoint: [event locationInWindow] fromView: nil]];
    109109   
    110110    if (row >= 0)
     
    124124    NSRect iconRect = [cell imageRectForBounds: [self rectOfRow: row]];
    125125   
    126     iconRect.origin.x += [self indentationPerLevel] * (float)([self levelForRow: row] + 1);
     126    iconRect.origin.x += [self indentationPerLevel] * (CGFloat)([self levelForRow: row] + 1);
    127127    return iconRect;
    128128}
     
    154154}
    155155
    156 - (int) hoveredRow
     156- (NSInteger) hoveredRow
    157157{
    158158    return fMouseRow;
     
    192192           
    193193            NSSet * priorities = [fTorrent filePrioritiesForIndexes: indexes];
    194             int count = [priorities count];
     194            const NSUInteger count = [priorities count];
    195195            if (count == 1)
    196196            {
  • trunk/macosx/InfoWindowController.m

    r10125 r10131  
    15661566    for (Torrent * torrent in fTorrents)
    15671567    {
    1568         [fPeers addObjectsFromArray: [torrent peers]];
    1569         [fWebSeeds addObjectsFromArray: [torrent webSeeds]];
     1568        if ([torrent webSeedCount] > 0)
     1569            [fWebSeeds addObjectsFromArray: [torrent webSeeds]];
    15701570       
    15711571        known += [torrent totalPeersKnown];
     
    15741574        {
    15751575            anyActive = YES;
     1576            [fPeers addObjectsFromArray: [torrent peers]];
     1577           
    15761578            const NSUInteger connectedThis = [torrent totalPeersConnected];
    15771579            if (connectedThis > 0)
     
    16501652            activeString = NSLocalizedString(@"Transfers Not Active", "Inspector -> Peers tab -> peers");
    16511653       
    1652         NSString * connectedText = [NSString stringWithFormat: @"%@\n%@", activeString, knownString];
     1654        NSString * connectedText = [activeString stringByAppendingFormat: @"\n%@", knownString];
    16531655        [fConnectedPeersField setStringValue: connectedText];
    16541656    }
  • trunk/macosx/Torrent.m

    r10126 r10131  
    893893    NSMutableArray * webSeeds = [NSMutableArray arrayWithCapacity: fInfo->webseedCount];
    894894   
    895     if (fInfo->webseedCount > 0)
    896     {
    897         float * dlSpeeds = tr_torrentWebSpeeds(fHandle);
    898        
    899         for (NSInteger i = 0; i < fInfo->webseedCount; i++)
    900         {
    901             NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithCapacity: 3];
    902            
    903             [dict setObject: [self name] forKey: @"Name"];
    904             [dict setObject: [NSString stringWithUTF8String: fInfo->webseeds[i]] forKey: @"Address"];
    905            
    906             if (dlSpeeds[i] != -1.0)
    907                 [dict setObject: [NSNumber numberWithFloat: dlSpeeds[i]] forKey: @"DL From Rate"];
    908            
    909             [webSeeds addObject: dict];
    910         }
    911        
    912         tr_free(dlSpeeds);
    913     }
     895    float * dlSpeeds = tr_torrentWebSpeeds(fHandle);
     896   
     897    for (NSInteger i = 0; i < fInfo->webseedCount; i++)
     898    {
     899        NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithCapacity: 3];
     900       
     901        [dict setObject: [self name] forKey: @"Name"];
     902        [dict setObject: [NSString stringWithUTF8String: fInfo->webseeds[i]] forKey: @"Address"];
     903       
     904        if (dlSpeeds[i] != -1.0)
     905            [dict setObject: [NSNumber numberWithFloat: dlSpeeds[i]] forKey: @"DL From Rate"];
     906       
     907        [webSeeds addObject: dict];
     908    }
     909   
     910    tr_free(dlSpeeds);
    914911   
    915912    return webSeeds;
Note: See TracChangeset for help on using the changeset viewer.