mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
* 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:
parent
343999460b
commit
6bd3b14d85
2 changed files with 14 additions and 4 deletions
|
@ -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>
|
||||
|
||||
* Headers/AppKit/NSSpeechSynthesizer.h: Added _module ivar.
|
||||
|
|
|
@ -122,7 +122,6 @@ static NSDictionary *TypeInfoForHumanReadableName (NSArray *types, NSString *typ
|
|||
- (IBAction) _openRecentDocument: (id)sender;
|
||||
@end
|
||||
|
||||
|
||||
/** <p>
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue