Changeset 11756


Ignore:
Timestamp:
Jan 23, 2011, 6:23:52 PM (11 years ago)
Author:
livings124
Message:

#3940 Global displayed speed does not include webseeds; remove a now-unused libT speed function

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/session.c

    r11752 r11756  
    16751675    return tr_isSession( session ) ? tr_bandwidthGetPieceSpeed_Bps( session->bandwidth, 0, dir ) : 0;
    16761676}
    1677 double
    1678 tr_sessionGetPieceSpeed_KBps( const tr_session * session, tr_direction dir )
    1679 {
    1680     return toSpeedKBps( tr_sessionGetPieceSpeed_Bps( session, dir ) );
    1681 }
    16821677
    16831678int
  • trunk/libtransmission/transmission.h

    r11709 r11756  
    691691
    692692double     tr_sessionGetRawSpeed_KBps  ( const tr_session *, tr_direction );
    693 double     tr_sessionGetPieceSpeed_KBps( const tr_session *, tr_direction );
    694693
    695694void       tr_sessionSetRatioLimited  ( tr_session *, tr_bool isLimited );
  • trunk/macosx/Badger.h

    r11617 r11756  
    3535- (id) initWithLib: (tr_session *) lib;
    3636
    37 - (void) updateBadge;
     37- (void) updateBadgeWithDownload: (CGFloat) downloadRate upload: (CGFloat) uploadRate;
    3838- (void) incrementCompleted;
    3939- (void) clearCompleted;
  • trunk/macosx/Badger.m

    r11617 r11756  
    3939        [[NSApp dockTile] setContentView: view];
    4040        [view release];
    41        
    42         //change that just impacts the dock badge
    43         [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(updateBadge) name: @"DockBadgeChange" object: nil];
    4441    }
    4542   
     
    5451}
    5552
    56 - (void) updateBadge
     53- (void) updateBadgeWithDownload: (CGFloat) downloadRate upload: (CGFloat) uploadRate
    5754{
    58     const double downloadRate = [[NSUserDefaults standardUserDefaults] boolForKey: @"BadgeDownloadRate"]
    59                                 ? tr_sessionGetPieceSpeed_KBps(fLib, TR_DOWN) : 0.0;
    60     const double uploadRate = [[NSUserDefaults standardUserDefaults] boolForKey: @"BadgeUploadRate"]
    61                                 ? tr_sessionGetPieceSpeed_KBps(fLib, TR_UP) : 0.0;
     55    const CGFloat displayDlRate = [[NSUserDefaults standardUserDefaults] boolForKey: @"BadgeDownloadRate"]
     56                                ? downloadRate : 0.0;
     57    const CGFloat displayUlRate = [[NSUserDefaults standardUserDefaults] boolForKey: @"BadgeUploadRate"]
     58                                ? uploadRate : 0.0;
    6259   
    6360    //only update if the badged values change
    64     if ([(BadgeView *)[[NSApp dockTile] contentView] setRatesWithDownload: downloadRate upload: uploadRate])
     61    if ([(BadgeView *)[[NSApp dockTile] contentView] setRatesWithDownload: displayDlRate upload: displayUlRate])
    6562        [[NSApp dockTile] display];
    6663}
  • trunk/macosx/Controller.m

    r11688 r11756  
    17181718    [fTorrents makeObjectsPerformSelector: @selector(update)];
    17191719   
     1720    //pull the upload and download speeds - most consistent by using current stats
     1721    CGFloat dlRate = 0.0, ulRate = 0.0;
     1722    for (Torrent * torrent in fTorrents)
     1723    {
     1724        dlRate += [torrent downloadRate];
     1725        ulRate += [torrent uploadRate];
     1726    }
     1727   
    17201728    if (![NSApp isHidden])
    17211729    {
     
    17281736            {
    17291737                //set rates
    1730                 [fTotalDLField setStringValue: [NSString stringForSpeed: tr_sessionGetPieceSpeed_KBps(fLib, TR_DOWN)]];
    1731                 [fTotalULField setStringValue: [NSString stringForSpeed: tr_sessionGetPieceSpeed_KBps(fLib, TR_UP)]];
     1738                [fTotalDLField setStringValue: [NSString stringForSpeed: dlRate]];
     1739                [fTotalULField setStringValue: [NSString stringForSpeed: ulRate]];
    17321740               
    17331741                //set status button text
     
    17711779   
    17721780    //badge dock
    1773     [fBadger updateBadge];
     1781    [fBadger updateBadgeWithDownload: dlRate upload: ulRate];
    17741782}
    17751783
Note: See TracChangeset for help on using the changeset viewer.