Overrides the standard -infoDictionary method via a category name-clash. Forces the bundle to manually load and return the contents of 'info-gnustep.plist'.
21{
22 NSFileManager* fileManager = [NSFileManager defaultManager];
23 NSString* startingDir = [fileManager currentDirectoryPath];
24
25 NSString* primaryResourcesPath = [startingDir stringByAppendingPathComponent:@"Resources"];
26 BOOL isDir = NO;
27
28 NSString* resourcesFolder =
nil;
29 if ([fileManager fileExistsAtPath:primaryResourcesPath isDirectory:&isDir] && isDir) {
30 resourcesFolder = primaryResourcesPath;
31 } else {
32
33 NSString* fallbackPath = [[startingDir stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"share/oolite/Resources"];
34 resourcesFolder = [fallbackPath stringByStandardizingPath];
35 }
36
37
38 NSString* plistPath = [resourcesFolder stringByAppendingPathComponent:@"Info-gnustep.plist"];
39
40
41 NSDictionary* gnustepPlist = [NSDictionary dictionaryWithContentsOfFile:plistPath];
42 NSMutableDictionary* workingDict =
nil;
43
44 if (gnustepPlist) {
45 workingDict = [gnustepPlist mutableCopy];
46 } else {
47
48 workingDict = [[NSMutableDictionary alloc] init];
49 NSLog(
@"[Oolite-Core] Warning: Failed to find info-gnustep.plist at calculated path: %@", plistPath);
50 }
51
52
53 return [workingDict autorelease];
54}
#define NSLog(format,...)