From 240173b8d4a41c66ffc261af46089cd4593b221c Mon Sep 17 00:00:00 2001 From: Robert Slover Date: Sat, 13 Jan 2001 20:46:59 +0000 Subject: [PATCH] fix in the bundle project related to the principal class. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@8587 72102866-910b-0410-8b05-ffd578937521 --- PCBundleProj/PCBundleMakefileFactory.m | 3 ++- PCLib/PCFileManager.m | 9 ++++++++- PCLib/PCProject.m | 4 +++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/PCBundleProj/PCBundleMakefileFactory.m b/PCBundleProj/PCBundleMakefileFactory.m index ac0f6c6..7f7e9f6 100644 --- a/PCBundleProj/PCBundleMakefileFactory.m +++ b/PCBundleProj/PCBundleMakefileFactory.m @@ -84,7 +84,8 @@ static PCBundleMakefileFactory *_factory = nil; if ((tmp = [prDict objectForKey:PCPrincipalClass]) && [tmp isEqualToString:@""] == NO) { } - else if ((tmp = [[prDict objectForKey:PCClasses] objectAtIndex:0])) { + else if (([[prDict objectForKey:PCClasses] count])) { + tmp = [[[prDict objectForKey:PCClasses] objectAtIndex:0] stringByDeletingPathExtension]; } else { tmp = [NSString string]; diff --git a/PCLib/PCFileManager.m b/PCLib/PCFileManager.m index f56c6fe..8f1cdc9 100644 --- a/PCLib/PCFileManager.m +++ b/PCLib/PCFileManager.m @@ -212,7 +212,9 @@ static PCFileManager *_mgr = nil; NSString *title = nil; NSArray *types = nil; - if (delegate && [delegate respondsToSelector:@selector(fileManagerWillAddFiles:)]) { + if (delegate && + [delegate respondsToSelector:@selector(fileManagerWillAddFiles:)]) { + if (!(project = [delegate fileManagerWillAddFiles:self])) { NSLog(@"No project to add files available..."); return; @@ -220,9 +222,14 @@ static PCFileManager *_mgr = nil; } key = [project selectedRootCategory]; + + NSLog(@"Key: %@",key); + title = [[[project rootCategories] allKeysForObject:key] objectAtIndex:0]; title = [NSString stringWithFormat:@"Add to %@...",title]; + NSLog(@"Title is %@ (Key %@)",title,key); + types = [project fileExtensionsForCategory:key]; openPanel = [NSOpenPanel openPanel]; diff --git a/PCLib/PCProject.m b/PCLib/PCProject.m index 797ec96..e55cd6d 100644 --- a/PCLib/PCProject.m +++ b/PCLib/PCProject.m @@ -453,7 +453,9 @@ - (NSString *)selectedRootCategory { - return [self projectKeyForKeyPath:[browserController pathOfSelectedFile]]; + NSString *_path = [browserController pathOfSelectedFile]; + + return [self projectKeyForKeyPath:_path]; } - (NSArray *)fileExtensionsForCategory:(NSString *)key