mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
Tidied indentation.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3662 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3d9f74723d
commit
3f9a08c193
2 changed files with 51 additions and 36 deletions
|
@ -72,27 +72,27 @@
|
||||||
if ([fileManager fileExistsAtPath: lockDir isDirectory: &isDirectory] == NO)
|
if ([fileManager fileExistsAtPath: lockDir isDirectory: &isDirectory] == NO)
|
||||||
{
|
{
|
||||||
NSLog(@"part of the path to the lock file '%@' is missing\n", lockPath);
|
NSLog(@"part of the path to the lock file '%@' is missing\n", lockPath);
|
||||||
[self dealloc];
|
[self release];
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
if (isDirectory == NO)
|
if (isDirectory == NO)
|
||||||
{
|
{
|
||||||
NSLog(@"part of the path to the lock file '%@' is not a directory\n",
|
NSLog(@"part of the path to the lock file '%@' is not a directory\n",
|
||||||
lockPath);
|
lockPath);
|
||||||
[self dealloc];
|
[self release];
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
if ([fileManager isWritableFileAtPath: lockDir] == NO)
|
if ([fileManager isWritableFileAtPath: lockDir] == NO)
|
||||||
{
|
{
|
||||||
NSLog(@"parent directory of lock file '%@' is not writable\n", lockPath);
|
NSLog(@"parent directory of lock file '%@' is not writable\n", lockPath);
|
||||||
[self dealloc];
|
[self release];
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
if ([fileManager isExecutableFileAtPath: lockDir] == NO)
|
if ([fileManager isExecutableFileAtPath: lockDir] == NO)
|
||||||
{
|
{
|
||||||
NSLog(@"parent directory of lock file '%@' is not accessible\n",
|
NSLog(@"parent directory of lock file '%@' is not accessible\n",
|
||||||
lockPath);
|
lockPath);
|
||||||
[self dealloc];
|
[self release];
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
|
|
|
@ -627,7 +627,7 @@ static NSMutableString *processName = nil;
|
||||||
|
|
||||||
if (tickingTimer == nil)
|
if (tickingTimer == nil)
|
||||||
{
|
{
|
||||||
[NSTimer scheduledTimerWithTimeInterval:30
|
tickingTimer = [NSTimer scheduledTimerWithTimeInterval: 30
|
||||||
target: self
|
target: self
|
||||||
selector: @selector(__timerTicked:)
|
selector: @selector(__timerTicked:)
|
||||||
userInfo: nil
|
userInfo: nil
|
||||||
|
@ -636,21 +636,29 @@ static NSMutableString *processName = nil;
|
||||||
|
|
||||||
// Get file lock - break any lock that is more than five minute old.
|
// Get file lock - break any lock that is more than five minute old.
|
||||||
if ([defaultsDatabaseLock tryLock] == NO)
|
if ([defaultsDatabaseLock tryLock] == NO)
|
||||||
|
{
|
||||||
if ([[defaultsDatabaseLock lockDate] timeIntervalSinceNow] < -300.0)
|
if ([[defaultsDatabaseLock lockDate] timeIntervalSinceNow] < -300.0)
|
||||||
{
|
{
|
||||||
[defaultsDatabaseLock breakLock];
|
[defaultsDatabaseLock breakLock];
|
||||||
if ([defaultsDatabaseLock tryLock] == NO)
|
if ([defaultsDatabaseLock tryLock] == NO)
|
||||||
|
{
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
return NO;
|
return NO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DESTROY(dictionaryRep);
|
DESTROY(dictionaryRep);
|
||||||
|
|
||||||
// Read the persistent data from the stored database
|
// Read the persistent data from the stored database
|
||||||
if ([[NSFileManager defaultManager] fileExistsAtPath: defaultsDatabase])
|
if ([[NSFileManager defaultManager] fileExistsAtPath: defaultsDatabase])
|
||||||
|
{
|
||||||
newDict = [[NSMutableDictionary allocWithZone: [self zone]]
|
newDict = [[NSMutableDictionary allocWithZone: [self zone]]
|
||||||
initWithContentsOfFile: defaultsDatabase];
|
initWithContentsOfFile: defaultsDatabase];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSLog(@"Creating defaults database file %@", defaultsDatabase);
|
NSLog(@"Creating defaults database file %@", defaultsDatabase);
|
||||||
|
@ -660,8 +668,10 @@ static NSMutableString *processName = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!newDict)
|
if (!newDict)
|
||||||
|
{
|
||||||
newDict = [[NSMutableDictionary allocWithZone: [self zone]]
|
newDict = [[NSMutableDictionary allocWithZone: [self zone]]
|
||||||
initWithCapacity: 1];
|
initWithCapacity: 1];
|
||||||
|
}
|
||||||
|
|
||||||
if (changedDomains)
|
if (changedDomains)
|
||||||
{ // Synchronize both dictionaries
|
{ // Synchronize both dictionaries
|
||||||
|
@ -671,11 +681,15 @@ static NSMutableString *processName = nil;
|
||||||
while ((obj = [enumerator nextObject]))
|
while ((obj = [enumerator nextObject]))
|
||||||
{
|
{
|
||||||
dict = [persDomains objectForKey: obj];
|
dict = [persDomains objectForKey: obj];
|
||||||
if (dict) // Domane was added or changet
|
if (dict) // Domain was added or changet
|
||||||
|
{
|
||||||
[newDict setObject: dict forKey: obj];
|
[newDict setObject: dict forKey: obj];
|
||||||
|
}
|
||||||
else // Domain was removed
|
else // Domain was removed
|
||||||
|
{
|
||||||
[newDict removeObjectForKey: obj];
|
[newDict removeObjectForKey: obj];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
[persDomains release];
|
[persDomains release];
|
||||||
persDomains = newDict;
|
persDomains = newDict;
|
||||||
// Save the changes
|
// Save the changes
|
||||||
|
@ -698,9 +712,10 @@ static NSMutableString *processName = nil;
|
||||||
object: nil];
|
object: nil];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
[newDict release];
|
[newDict release];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue