Changeset 207


Ignore:
Timestamp:
Apr 5, 2006, 12:21:16 PM (16 years ago)
Author:
titer
Message:

Cleaning, also fixes disabling idle sleep when torrents are active

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.h

    r168 r207  
    3434{
    3535    tr_handle_t                 * fLib;
    36     int                         fCount, fSeeding, fDownloading, fCompleted;
     36    int                         fCount, fCompleted;
    3737    NSMutableArray              * fTorrents;
    3838
  • trunk/macosx/Controller.m

    r193 r207  
    146146
    147147    //update the interface every 500 ms
    148     fDownloading = 0;
    149     fSeeding = 0;
    150148    fCompleted = 0;
    151149    [self updateUI: nil];
     
    944942                          (void *) messageArgument
    945943{
    946     NSEnumerator * enumerator;;
     944    NSEnumerator * enumerator;
    947945    Torrent * torrent;
     946    BOOL active;
    948947
    949948    switch( messageType )
     
    976975        case kIOMessageCanSystemSleep:
    977976            /* Prevent idle sleep unless all paused */
    978             if (fDownloading > 0 || fSeeding > 0)
     977            active = NO;
     978            enumerator = [fTorrents objectEnumerator];
     979            while( !active && ( torrent = [enumerator nextObject] ) )
     980                if( [torrent isActive] )
     981                    active = YES;
     982
     983            if (active)
    979984                IOCancelPowerChange( fRootPort, (long) messageArgument );
    980985            else
Note: See TracChangeset for help on using the changeset viewer.