Add auto shutdown for gdnc and filesystem fixup for spelling dictionaries

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24787 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2007-03-06 18:38:22 +00:00
parent 88059b226b
commit cbcf93e905
4 changed files with 42 additions and 5 deletions

View file

@ -710,17 +710,29 @@ static NSDistributedNotificationCenter *netCenter = nil;
if (_type == GSNetworkNotificationCenterType)
{
args = [NSArray arrayWithObjects:
@"-GSNetwork", @"YES", nil];
@"-GSNetwork", @"YES",
@"--auto",
nil];
}
else if (_type == GSPublicNotificationCenterType)
{
args = [NSArray arrayWithObjects:
@"-GSPublic", @"YES", nil];
@"-GSPublic", @"YES",
@"--auto",
nil];
}
else if ([host length] > 0)
{
args = [NSArray arrayWithObjects:
@"-NSHost", host, nil];
@"-NSHost", host,
@"--auto",
nil];
}
else
{
args = [NSArray arrayWithObjects:
@"--auto",
nil];
}
[NSTask launchedTaskWithLaunchPath: cmd arguments: args];

View file

@ -173,7 +173,7 @@ GSSpellServerName(NSString *vendor, NSString *language)
NSString *path = nil;
NSString *user_gsroot = nil;
user_gsroot = [NSSearchPathForDirectoriesInDomains(NSUserDirectory,
user_gsroot = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
NSUserDomainMask, YES) lastObject];
if (currentLanguage != nil)
@ -182,7 +182,8 @@ GSSpellServerName(NSString *vendor, NSString *language)
NSFileManager *mgr = [NSFileManager defaultManager];
// Build the path and try to get the dictionary
dirPath = [user_gsroot stringByAppendingPathComponent: GNU_UserDictionariesDir];
dirPath = [user_gsroot stringByAppendingPathComponent:
GNU_UserDictionariesDir];
path = [dirPath stringByAppendingPathComponent: currentLanguage];
if (![mgr fileExistsAtPath: path ])
@ -236,6 +237,7 @@ GSSpellServerName(NSString *vendor, NSString *language)
if ((path = [self _pathToDictionary: language]) != nil)
{
NSArray *wordarray = [NSArray arrayWithContentsOfFile: path];
if (wordarray == nil)
{
NSLog(@"Unable to load user dictionary from path %@",path);
@ -351,6 +353,7 @@ is a set of words learned by the spell service for that particular user.
if ((path = [self _pathToDictionary: language]) != nil)
{
NSMutableSet *set = [_userDictionaries objectForKey: language];
if (![[set allObjects] writeToFile: path atomically: YES])
{
NSLog(@"Unable to save dictionary to path %@",path);