--- core/gui/Tools/make_services.m 2005-11-18 14:19:37.000000000 -0800 +++ core.mod/gui/Tools/make_services.m 2005-11-18 14:20:33.000000000 -0800 @@ -642,6 +642,38 @@ NSArray *contents = [mgr directoryContentsAtPath: path]; unsigned index; + /* It would make more sense if applicationMap were created before + scanDynamic were called, but for now just create a temporary + cache */ + NSMutableDictionary *tempAppMap = [NSMutableDictionary + dictionaryWithCapacity: 64]; + + NSEnumerator *e = [NSSearchPathForDirectoriesInDomains( + NSAllApplicationsDirectory, NSAllDomainsMask, YES) objectEnumerator]; + NSString *appDomain; + + while ((appDomain = [e nextObject]) != nil) + { + NSArray *dirList = [mgr directoryContentsAtPath: appDomain]; + + int i; + for (i = 0; i < [dirList count]; i++) + { + NSString *app = [dirList objectAtIndex: i]; + NSString *pathExt = [app pathExtension]; + + if (pathExt!=nil && [pathExt isEqualToString: @"app"] || + [pathExt isEqualToString: @"debug"] || + [pathExt isEqualToString: @"profile"]) + { + [tempAppMap setObject: + [appDomain stringByAppendingPathComponent: app] + forKey: [app stringByDeletingPathExtension]]; + } + } + } + + for (index = 0; index < [contents count]; index++) { NSString *name = [contents objectAtIndex: index]; @@ -672,8 +704,20 @@ NSMutableArray *entry; entry = validateEntry(svcs, infPath); + + if (entry) { + int i; + for (i = 0; i <[entry count]; i++) + { + id dict = [entry objectAtIndex: i]; + NSString *portName = [dict objectForKey: @"NSPortName"]; + NSString *appPath = [tempAppMap objectForKey: portName]; + if (appPath) + [dict setObject: appPath forKey: @"ServicePath"]; + } + [services setObject: entry forKey: infPath]; } }