diff --git a/ChangeLog b/ChangeLog index 5b881d82f..f366f2457 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-11-20 Richard Frith-Macdonald + + * Source/GSServicesManager.m: GSContactApplication() + Fix bug launching application ... if it's not available in the + services bundle, locate application by name (from the port). + 2005-11-18 fabien * Source/NSSliderCell.m: Improved documentation diff --git a/Source/GSServicesManager.m b/Source/GSServicesManager.m index b2bad88df..9b20adfe6 100644 --- a/Source/GSServicesManager.m +++ b/Source/GSServicesManager.m @@ -1419,6 +1419,10 @@ static NSString *disabledName = @".GNUstepDisabled"; * it will be inferred from appName ... by convention, applications * use their own name (minus any path or extension) for this. *

+ *

If appName is nil or cannot be launched, this attempts to locate any + * application in a standard location whose name matches port and launch + * that application. + *

*

The value of expire provides a timeout in case the application cannot * be contacted promptly. If it is omitted, a thirty second timeout is * used. @@ -1456,9 +1460,14 @@ GSContactApplication(NSString *appName, NSString *port, NSDate *expire) } if (app == nil) { - if ([[NSWorkspace sharedWorkspace] launchApplication: appName] == NO) + if (appName == nil + || [[NSWorkspace sharedWorkspace] launchApplication: appName] == NO) { - return nil; /* Unable to launch. */ + if (port == nil + || [[NSWorkspace sharedWorkspace] launchApplication: port] == NO) + { + return nil; /* Unable to launch. */ + } } NS_DURING diff --git a/Source/NSWorkspace.m b/Source/NSWorkspace.m index 3ff0e98a7..c2e638468 100644 --- a/Source/NSWorkspace.m +++ b/Source/NSWorkspace.m @@ -1301,8 +1301,8 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath { end++; } - len = (end - ptr) * sizeof(unichar); - path = [mgr stringWithFileSystemRepresentation: (char*)ptr length: len]; + len = (end - ptr); + path = [mgr stringWithFileSystemRepresentation: ptr length: len]; [names addObject: path]; } if (base != buf)