git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4157 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-04-28 14:22:19 +00:00
parent 3b497c4330
commit ad83de41ad

View file

@ -60,7 +60,7 @@ static NSString *appListName = @"Services/.GNUstepAppList";
static NSString *appListPath = nil;
static NSDictionary *applications = nil;
static NSString *extPrefName = @".GNUstepExtPrefs";
static NSString *extPrefName = @"Services/.GNUstepExtPrefs";
static NSString *extPrefPath = nil;
static NSDictionary *extPreferences = nil;
@ -74,6 +74,7 @@ static NSString *_rootPath = @"/";
if (self == [NSWorkspace class])
{
static BOOL beenHere;
NSFileManager *mgr = [NSFileManager defaultManager];
NSDictionary *env;
NSString *home;
NSData *data;
@ -110,12 +111,15 @@ static NSString *_rootPath = @"/";
*/
extPrefPath = [home stringByAppendingPathComponent: extPrefName];
[extPrefPath retain];
data = [NSData dataWithContentsOfFile: extPrefPath];
if (data)
if ([mgr isReadableFileAtPath: extPrefPath] == YES)
{
dict = [NSDeserializer deserializePropertyListFromData: data
mutableContainers: NO];
extPreferences = [dict retain];
data = [NSData dataWithContentsOfFile: extPrefPath];
if (data)
{
dict = [NSDeserializer deserializePropertyListFromData: data
mutableContainers: NO];
extPreferences = [dict retain];
}
}
/*
@ -123,14 +127,16 @@ static NSString *_rootPath = @"/";
*/
appListPath = [home stringByAppendingPathComponent: appListName];
[appListPath retain];
data = [NSData dataWithContentsOfFile: appListPath];
if (data)
if ([mgr isReadableFileAtPath: appListPath] == YES)
{
dict = [NSDeserializer deserializePropertyListFromData: data
mutableContainers: NO];
applications = [dict retain];
data = [NSData dataWithContentsOfFile: appListPath];
if (data)
{
dict = [NSDeserializer deserializePropertyListFromData: data
mutableContainers: NO];
applications = [dict retain];
}
}
[gnustep_global_lock unlock];
}
}
@ -729,6 +735,7 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
- (void) findApplications
{
static NSString *path = nil;
NSFileManager *mgr = [NSFileManager defaultManager];
NSData *data;
NSDictionary *dict;
NSTask *task;
@ -744,20 +751,26 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
if (task != nil)
[task waitUntilExit];
data = [NSData dataWithContentsOfFile: extPrefPath];
if (data)
if ([mgr isReadableFileAtPath: extPrefPath] == YES)
{
dict = [NSDeserializer deserializePropertyListFromData: data
mutableContainers: NO];
ASSIGN(extPreferences, dict);
data = [NSData dataWithContentsOfFile: extPrefPath];
if (data)
{
dict = [NSDeserializer deserializePropertyListFromData: data
mutableContainers: NO];
ASSIGN(extPreferences, dict);
}
}
data = [NSData dataWithContentsOfFile: appListPath];
if (data)
if ([mgr isReadableFileAtPath: appListPath] == YES)
{
dict = [NSDeserializer deserializePropertyListFromData: data
mutableContainers: NO];
ASSIGN(applications, dict);
data = [NSData dataWithContentsOfFile: appListPath];
if (data)
{
dict = [NSDeserializer deserializePropertyListFromData: data
mutableContainers: NO];
ASSIGN(applications, dict);
}
}
/*
* Invalidate the cache of icons for file extensions.