From c47c417df76e00183cf02324142fc646769030eb Mon Sep 17 00:00:00 2001 From: rmottola Date: Sun, 25 Jan 2009 13:05:47 +0000 Subject: [PATCH] When getting the name for a human readable document type name, use also CFBundleTypeName. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27684 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Source/NSDocumentController.m | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 53b01dd80..384cef16f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-01-25 Fred Kiefer + + * Source/NSDocumentController.m (-_nameForHumanReadableType:): Also + look at CFBundleTypeName. + 2009-01-25 06:47-EST Gregory John Casamento * Source/NSMenuView.m: Refactor code which executes the action diff --git a/Source/NSDocumentController.m b/Source/NSDocumentController.m index b934ef26d..08dceb359 100644 --- a/Source/NSDocumentController.m +++ b/Source/NSDocumentController.m @@ -1377,9 +1377,16 @@ static BOOL _shouldClose = YES; return [self _editorTypesForClass: documentClass]; } -- (NSString *) _nameForHumanReadableType: (NSString *)type +- (NSString *) _nameForHumanReadableType: (NSString *)typeHR { - return [HR_TYPE_INFO(type) objectForKey: NSNameKey]; + NSDictionary *typeInfo = HR_TYPE_INFO(typeHR); + NSString *type = [typeInfo objectForKey: NSNameKey]; + + if(type == nil) + { + type = [typeInfo objectForKey: CFBundleTypeName]; + } + return type; } - (NSArray *) _displayNamesForTypes: (NSArray *)types