simplify the time machine updating method
This commit is contained in:
parent
821b215f37
commit
085302f15f
|
@ -1395,40 +1395,26 @@ int trashDataFile(const char * filename)
|
||||||
|
|
||||||
- (void) updateTimeMachineExclude
|
- (void) updateTimeMachineExclude
|
||||||
{
|
{
|
||||||
NSString * newLocation = nil;
|
NSString * currentLocation = ![self allDownloaded] ? [self dataLocation] : nil;
|
||||||
BOOL checkedNewLocation = NO;
|
|
||||||
|
|
||||||
|
//return if the locations are the same
|
||||||
|
if (fTimeMachineExclude && currentLocation && [fTimeMachineExclude isEqualToString: currentLocation])
|
||||||
|
return;
|
||||||
|
|
||||||
|
//remove old location...
|
||||||
if (fTimeMachineExclude)
|
if (fTimeMachineExclude)
|
||||||
{
|
{
|
||||||
//long-winded way of saying "return if the locations are the same and not all is downloaded"
|
|
||||||
if (![self allDownloaded])
|
|
||||||
{
|
|
||||||
newLocation = [self dataLocation];
|
|
||||||
checkedNewLocation = YES;
|
|
||||||
|
|
||||||
if (newLocation && [fTimeMachineExclude isEqualToString: newLocation])
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
[self setTimeMachineExclude: NO forPath: fTimeMachineExclude];
|
[self setTimeMachineExclude: NO forPath: fTimeMachineExclude];
|
||||||
[fTimeMachineExclude release];
|
[fTimeMachineExclude release];
|
||||||
fTimeMachineExclude = nil;
|
fTimeMachineExclude = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (![self allDownloaded])
|
//...set new location
|
||||||
|
if (currentLocation)
|
||||||
{
|
{
|
||||||
if (!checkedNewLocation)
|
[self setTimeMachineExclude: YES forPath: currentLocation];
|
||||||
{
|
|
||||||
newLocation = [self dataLocation];
|
|
||||||
checkedNewLocation = YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (newLocation)
|
|
||||||
{
|
|
||||||
[self setTimeMachineExclude: YES forPath: newLocation];
|
|
||||||
[fTimeMachineExclude release];
|
[fTimeMachineExclude release];
|
||||||
fTimeMachineExclude = [newLocation retain];
|
fTimeMachineExclude = [currentLocation retain];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue