Ignore:
Timestamp:
Oct 21, 2009, 11:13:02 PM (13 years ago)
Author:
livings124
Message:

more efficient time machine location check

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r9349 r9350  
    254254   
    255255    //when the data first appears, update time machine exclusion
    256     #warning perhaps always check to get if the file is moved through rpc
    257256    if (!fTimeMachineExclude)
    258257        [self updateTimeMachineExclude];
     
    481480        [alert release];
    482481    }
     482   
     483    [self updateTimeMachineExclude];
    483484}
    484485
     
    14601461- (void) updateTimeMachineExclude
    14611462{
    1462     NSString * newLocation = [self dataLocation];
    1463    
    1464     if (fTimeMachineExclude && newLocation && [fTimeMachineExclude isEqualToString: newLocation] && ![self allDownloaded])
    1465         return;
     1463    NSString * newLocation = nil;
     1464    BOOL checkedNewLocation = NO;
    14661465   
    14671466    if (fTimeMachineExclude)
    14681467    {
     1468        //long-winded way of saying "return if the locations are the same and not all is downloaded"
     1469        if (![self allDownloaded])
     1470        {
     1471            newLocation = [self dataLocation];
     1472            checkedNewLocation = YES;
     1473           
     1474            if ([fTimeMachineExclude isEqualToString: newLocation])
     1475                return;
     1476        }
     1477       
    14691478        [self setTimeMachineExclude: NO forPath: fTimeMachineExclude];
    14701479        [fTimeMachineExclude release];
     
    14721481    }
    14731482   
    1474     if (newLocation && ![self allDownloaded])
    1475     {
    1476         [self setTimeMachineExclude: YES forPath: newLocation];
    1477         [fTimeMachineExclude release];
    1478         fTimeMachineExclude = [newLocation retain];
     1483    if (![self allDownloaded])
     1484    {
     1485        if (!checkedNewLocation)
     1486        {
     1487            newLocation = [self dataLocation];
     1488            checkedNewLocation = YES;
     1489        }
     1490       
     1491        if (newLocation)
     1492        {
     1493            [self setTimeMachineExclude: YES forPath: newLocation];
     1494            [fTimeMachineExclude release];
     1495            fTimeMachineExclude = [newLocation retain];
     1496        }
    14791497    }
    14801498}
     
    17161734    fStat = tr_torrentStat(fHandle); //don't call update yet to avoid auto-stop
    17171735   
    1718     BOOL canMove;
    17191736    switch ([status intValue])
    17201737    {
Note: See TracChangeset for help on using the changeset viewer.