Changeset 506


Ignore:
Timestamp:
Jul 2, 2006, 10:59:23 PM (15 years ago)
Author:
livings124
Message:

Start and stop transfers for launch/quit without performing checks for waiting transfers, etc. This should fix saving the incorrect states of running transfers between launches.

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r504 r506  
    303303- (void) applicationWillTerminate: (NSNotification *) notification
    304304{
    305     // Stop updating the interface
     305    //stop updating the interface
    306306    [fTimer invalidate];
    307307   
     
    321321        return;
    322322
    323     //stop running torrents and wait for them to stop (5 seconds timeout)
    324     [fTorrents makeObjectsPerformSelector: @selector(stopTransfer)];
    325    
     323    //stop running transfers and wait for them to stop (5 seconds timeout)
     324    [fTorrents makeObjectsPerformSelector: @selector(stopTransferForQuit)];
     325
    326326    NSDate * start = [NSDate date];
    327327    Torrent * torrent;
  • trunk/macosx/Torrent.h

    r465 r506  
    6767- (void)        startTransfer;
    6868- (void)        stopTransfer;
     69- (void)        stopTransferForQuit;
    6970- (void)        removeForever;
    7071- (void)        sleep;
  • trunk/macosx/Torrent.m

    r465 r506  
    7575        NSString * paused;
    7676        if (!(paused = [history objectForKey: @"Paused"]) || [paused isEqualToString: @"NO"])
    77             [self startTransfer];
     77            tr_torrentStart(fHandle);
    7878    }
    7979    return self;
     
    252252}
    253253
     254- (void) stopTransferForQuit
     255{
     256    if ([self isActive])
     257        tr_torrentStop(fHandle);
     258}
     259
    254260- (void) removeForever
    255261{
     
    608614    fWaitToStart = waitToStart ? [waitToStart boolValue]
    609615                    : ![[fDefaults stringForKey: @"StartSetting"] isEqualToString: @"Manual"];
     616    fOrderValue = orderValue ? [orderValue intValue] : tr_torrentCount(fLib) - 1;
    610617   
    611618    NSString * fileType = fInfo->multifile ? NSFileTypeForHFSTypeCode('fldr') : [[self name] pathExtension];
     
    618625    fProgressString = [[NSMutableString alloc] initWithCapacity: 50];
    619626    fStatusString = [[NSMutableString alloc] initWithCapacity: 75];
    620    
    621     fOrderValue = orderValue ? [orderValue intValue] : tr_torrentCount(fLib) - 1;
    622627
    623628    [self update];
Note: See TracChangeset for help on using the changeset viewer.