Changeset 9462


Ignore:
Timestamp:
Oct 31, 2009, 4:25:00 PM (13 years ago)
Author:
livings124
Message:

simplify the time machine updating method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r9461 r9462  
    13961396- (void) updateTimeMachineExclude
    13971397{
    1398     NSString * newLocation = nil;
    1399     BOOL checkedNewLocation = NO;
    1400    
     1398    NSString * currentLocation = ![self allDownloaded] ? [self dataLocation] : nil;
     1399   
     1400    //return if the locations are the same
     1401    if (fTimeMachineExclude && currentLocation && [fTimeMachineExclude isEqualToString: currentLocation])
     1402        return;
     1403   
     1404    //remove old location...
    14011405    if (fTimeMachineExclude)
    14021406    {
    1403         //long-winded way of saying "return if the locations are the same and not all is downloaded"
    1404         if (![self allDownloaded])
    1405         {
    1406             newLocation = [self dataLocation];
    1407             checkedNewLocation = YES;
    1408            
    1409             if (newLocation && [fTimeMachineExclude isEqualToString: newLocation])
    1410                 return;
    1411         }
    1412        
    14131407        [self setTimeMachineExclude: NO forPath: fTimeMachineExclude];
    14141408        [fTimeMachineExclude release];
     
    14161410    }
    14171411   
    1418     if (![self allDownloaded])
    1419     {
    1420         if (!checkedNewLocation)
    1421         {
    1422             newLocation = [self dataLocation];
    1423             checkedNewLocation = YES;
    1424         }
    1425        
    1426         if (newLocation)
    1427         {
    1428             [self setTimeMachineExclude: YES forPath: newLocation];
    1429             [fTimeMachineExclude release];
    1430             fTimeMachineExclude = [newLocation retain];
    1431         }
     1412    //...set new location
     1413    if (currentLocation)
     1414    {
     1415        [self setTimeMachineExclude: YES forPath: currentLocation];
     1416        [fTimeMachineExclude release];
     1417        fTimeMachineExclude = [currentLocation retain];
    14321418    }
    14331419}
Note: See TracChangeset for help on using the changeset viewer.