* Source/NSDocumentController.m: Return default type if the

URL is not a file URL and the call to typeFromFileExtension: returns
	nil in typeForContentsOfURL:.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28187 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
gcasa 2009-04-08 02:24:27 +00:00
parent b14f6d35eb
commit 6b3ab20fe5
2 changed files with 14 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2009-04-07 22:21-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* 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 <greg_casamento@yahoo.com> 2009-04-07 18:43-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Headers/AppKit/NSSpeechSynthesizer.h: Added _module ivar. * Headers/AppKit/NSSpeechSynthesizer.h: Added _module ivar.

View file

@ -122,7 +122,6 @@ static NSDictionary *TypeInfoForHumanReadableName (NSArray *types, NSString *typ
- (IBAction) _openRecentDocument: (id)sender; - (IBAction) _openRecentDocument: (id)sender;
@end @end
/** <p> /** <p>
NSDocumentController is a class that controls a set of NSDocuments NSDocumentController is a class that controls a set of NSDocuments
for an application. As an application delegate, it responds to the 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 - (NSString *) typeForContentsOfURL: (NSURL *)url error: (NSError **)err
{ {
// FIXME: open connection and get response to determine mine/type NSString *type = [self typeFromFileExtension: [[url path] pathExtension]];
// Should we only do this if [url isFileURL] is YES?
return [self typeFromFileExtension: [[url path] pathExtension]]; if([url isFileURL] == NO && type == nil)
{
return [self defaultType];
}
return type;
} }
- (NSArray *) fileExtensionsFromType: (NSString *)type - (NSArray *) fileExtensionsFromType: (NSString *)type