Changeset 3485


Ignore:
Timestamp:
Oct 20, 2007, 9:27:46 PM (14 years ago)
Author:
livings124
Message:

eliminate the redundant isPaused, instead using !isActive

Location:
trunk/macosx
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r3464 r3485  
    27792779        NSEnumerator * enumerator = [fTorrents objectEnumerator];
    27802780        while ((torrent = [enumerator nextObject]))
    2781             if ([torrent isPaused] && ![torrent waitingToStart])
     2781            if (![torrent isActive] && ![torrent waitingToStart])
    27822782                return YES;
    27832783        return NO;
     
    28012801        Torrent * torrent;
    28022802        while ((torrent = [enumerator nextObject]))
    2803             if ([torrent isPaused] && ![torrent waitingToStart])
     2803            if (![torrent isActive] && ![torrent waitingToStart])
    28042804                return YES;
    28052805        return NO;
     
    29282928        NSEnumerator * enumerator = [fTorrents objectEnumerator];
    29292929        while ((torrent = [enumerator nextObject]))
    2930             if ([torrent isPaused] && ![torrent waitingToStart])
     2930            if (![torrent isActive] && ![torrent waitingToStart])
    29312931                return YES;
    29322932        return NO;
     
    29422942        NSEnumerator * enumerator = [fTorrents objectEnumerator];
    29432943        while ((torrent = [enumerator nextObject]))
    2944             if ([torrent isPaused] && [torrent waitingToStart])
     2944            if (![torrent isActive] && [torrent waitingToStart])
    29452945                return YES;
    29462946        return NO;
     
    29562956        Torrent * torrent;
    29572957        while ((torrent = [enumerator nextObject]))
    2958             if ([torrent isPaused])
     2958            if (![torrent isActive])
    29592959                return YES;
    29602960        return NO;
     
    29842984        Torrent * torrent;
    29852985        while ((torrent = [enumerator nextObject]))
    2986             if ([torrent isPaused] && ![torrent waitingToStart])
     2986            if (![torrent isActive] && ![torrent waitingToStart])
    29872987                return YES;
    29882988        return NO;
     
    30563056            enumerator = [fTorrents objectEnumerator];
    30573057            while (!timeUp && (torrent = [enumerator nextObject]))
    3058                 while (![torrent isPaused] && !(timeUp = [start timeIntervalSinceNow] < -5.0))
     3058                while ([torrent isActive] && !(timeUp = [start timeIntervalSinceNow] < -5.0))
    30593059                {
    30603060                    usleep(100000);
  • trunk/macosx/InfoWindowController.m

    r3475 r3485  
    13461346    torrent = [enumerator nextObject]; //first torrent
    13471347   
    1348     BOOL pexEnabled = ![torrent privateTorrent] && [torrent isPaused];
     1348    BOOL pexEnabled = ![torrent privateTorrent] && ![torrent isActive];
    13491349    int pexState = [torrent pex] ? NSOnState : NSOffState;
    13501350   
     
    13521352    {
    13531353        if (pexEnabled)
    1354             pexEnabled = ![torrent privateTorrent] && [torrent isPaused];
     1354            pexEnabled = ![torrent privateTorrent] && ![torrent isActive];
    13551355       
    13561356        if (pexState != NSMixedState && pexState != ([torrent pex] ? NSOnState : NSOffState))
  • trunk/macosx/Torrent.h

    r3413 r3485  
    159159- (BOOL) isActive;
    160160- (BOOL) isSeeding;
    161 - (BOOL) isPaused;
    162161- (BOOL) isChecking;
    163162- (BOOL) allDownloaded;
  • trunk/macosx/Torrent.m

    r3483 r3485  
    730730- (BOOL) isActive
    731731{
    732     return fStat->status & TR_STATUS_ACTIVE;
     732    return fStat->status != TR_STATUS_STOPPED;
    733733}
    734734
     
    736736{
    737737    return fStat->status == TR_STATUS_SEED || fStat->status == TR_STATUS_DONE;
    738 }
    739 
    740 - (BOOL) isPaused
    741 {
    742     return fStat->status == TR_STATUS_STOPPED;
    743738}
    744739
  • trunk/macosx/TorrentTableView.m

    r3384 r3485  
    159159        if ([torrent isActive])
    160160            [fController stopTorrents: [NSArray arrayWithObject: torrent]];
    161         else if ([torrent isPaused])
     161        else
    162162        {
    163163            if ([[NSApp currentEvent] modifierFlags] & NSAlternateKeyMask)
     
    168168                [fController resumeTorrents: [NSArray arrayWithObject: torrent]];
    169169        }
    170         else;
    171170    }
    172171    else if (row == oldRow && [self pointInRevealRect: point] && [self pointInRevealRect: fClickPoint])
     
    461460    if ([torrent isActive])
    462461        pauseImage = fClickIn && NSPointInRect(fClickPoint, pauseRect) ? fPauseOnIcon : fPauseOffIcon;
    463     else if ([torrent isPaused])
     462    else
    464463    {
    465464        BOOL inPauseRect = fClickIn && NSPointInRect(fClickPoint, pauseRect);
     
    471470            pauseImage = inPauseRect ? fResumeOnIcon : fResumeOffIcon;
    472471    }
    473     else;
    474472   
    475473    if (pauseImage)
Note: See TracChangeset for help on using the changeset viewer.