Changeset 2559


Ignore:
Timestamp:
Jul 30, 2007, 10:19:52 PM (15 years ago)
Author:
livings124
Message:

use libtransmission's "can announce" functionality instead of custom mac code

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r2548 r2559  
    13251325    while ((torrent = [enumerator nextObject]))
    13261326    {
    1327         //time interval returned will be negative
    1328         if (!(date = [torrent announceDate]) || [date timeIntervalSinceNow] <= ANNOUNCE_WAIT_INTERVAL_SECONDS)
     1327        if ([torrent canAnnounce])
    13291328            [torrent announce];
    13301329    }
     
    28972896        {
    28982897            //time interval returned will be negative
    2899             if ([torrent isActive] &&
    2900                     (!(date = [torrent announceDate]) || [date timeIntervalSinceNow] <= ANNOUNCE_WAIT_INTERVAL_SECONDS))
     2898            if ([torrent canAnnounce])
    29012899                return YES;
    29022900        }
  • trunk/macosx/Torrent.h

    r2449 r2559  
    3838   
    3939    BOOL         fResumeOnWake;
    40     NSDate       * fDateAdded, * fDateCompleted, * fAnnounceDate,
    41                 * fDateActivity;
     40    NSDate       * fDateAdded, * fDateCompleted, * fDateActivity;
    4241   
    4342    BOOL        fUseIncompleteFolder;
     
    9392
    9493- (void) announce;
    95 - (NSDate *) announceDate;
     94- (BOOL) canAnnounce;
    9695
    9796- (void) resetCache;
  • trunk/macosx/Torrent.m

    r2548 r2559  
    171171    [fDateCompleted release];
    172172    [fDateActivity release];
    173    
    174     [fAnnounceDate release];
    175173   
    176174    [fIcon release];
     
    560558- (void) announce
    561559{
    562     if (![self isActive])
    563         return;
    564    
    565     #warning doesn't work!
    566560    tr_manualUpdate(fHandle);
    567    
    568     if (fAnnounceDate)
    569         [fAnnounceDate release];
    570     fAnnounceDate = [[NSDate date] retain];
    571 }
    572 
    573 - (NSDate *) announceDate
    574 {
    575     return fAnnounceDate;
     561}
     562
     563- (BOOL) canAnnounce
     564{
     565    return tr_torrentCanManualUpdate(fHandle);
    576566}
    577567
Note: See TracChangeset for help on using the changeset viewer.