diff --git a/ChangeLog b/ChangeLog index 33ab33f5c..0a7a0276c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-07 22:21-EDT Gregory John Casamento + + * Source/NSDocumentController.m: Return default type if the + URL is not a file URL and the call to typeFromFileExtension: returns + nil in typeForContentsOfURL:. + 2009-04-07 18:43-EDT Gregory John Casamento * Headers/AppKit/NSSpeechSynthesizer.h: Added _module ivar. diff --git a/Source/NSDocumentController.m b/Source/NSDocumentController.m index 08dceb359..19a533883 100644 --- a/Source/NSDocumentController.m +++ b/Source/NSDocumentController.m @@ -122,7 +122,6 @@ static NSDictionary *TypeInfoForHumanReadableName (NSArray *types, NSString *typ - (IBAction) _openRecentDocument: (id)sender; @end - /**

NSDocumentController is a class that controls a set of NSDocuments for an application. As an application delegate, it responds to the @@ -1173,9 +1172,14 @@ static BOOL _shouldClose = YES; - (NSString *) typeForContentsOfURL: (NSURL *)url error: (NSError **)err { - // FIXME: open connection and get response to determine mine/type - // Should we only do this if [url isFileURL] is YES? - return [self typeFromFileExtension: [[url path] pathExtension]]; + NSString *type = [self typeFromFileExtension: [[url path] pathExtension]]; + + if([url isFileURL] == NO && type == nil) + { + return [self defaultType]; + } + + return type; } - (NSArray *) fileExtensionsFromType: (NSString *)type