From a47c8aa7b880c5695c73089268f4dd65e960cc5d Mon Sep 17 00:00:00 2001 From: Sergii Stoian Date: Sat, 3 Jul 2004 13:30:04 +0000 Subject: [PATCH] Adding files to project fixes git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@19675 72102866-910b-0410-8b05-ffd578937521 --- Documentation/ChangeLog | 12 ++++++++++++ Library/PCProject.m | 10 +++++----- Library/PCProjectManager.m | 16 ++++++++++++++-- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Documentation/ChangeLog b/Documentation/ChangeLog index 4071588..f4f0431 100644 --- a/Documentation/ChangeLog +++ b/Documentation/ChangeLog @@ -1,3 +1,13 @@ +2004-07-03 Serg Stoyan + + * Library/PCProjectManager.m: + (addProjectFiles:): Don't copy files that already in project + directory structure. This allows adding of subproject's files to + project resources. + + * Across the ProjectCenter: Comment out calls for PCLog*. This is + speedup PC. + 2004-06-22 Serg Stoyan * Library/PCFileManager.m: @@ -15,6 +25,8 @@ * Library/PCFileManager.m: (panel:shouldShowFilename:): Fix filtering out files already included in project. Optimized. + + * GNUmakefile: Change VERSION var to 0.4.1pre. 2004-06-20 Serg Stoyan diff --git a/Library/PCProject.m b/Library/PCProject.m index 9dac44a..d0eb51f 100644 --- a/Library/PCProject.m +++ b/Library/PCProject.m @@ -1377,6 +1377,11 @@ NSString return category; }*/ +/*- (NSString *)keyForCategoryPath:(NSString *)categoryPath +{ + return [self keyForCategory:[self categoryForCategoryPath:categoryPath]]; +}*/ + - (NSString *)keyForRootCategoryInCategoryPath:(NSString *)categoryPath { NSString *category = nil; @@ -1398,10 +1403,5 @@ NSString return key; } -/*- (NSString *)keyForCategoryPath:(NSString *)categoryPath -{ - return [self keyForCategory:[self categoryForCategoryPath:categoryPath]]; -}*/ - @end diff --git a/Library/PCProjectManager.m b/Library/PCProjectManager.m index 9b96931..c587003 100644 --- a/Library/PCProjectManager.m +++ b/Library/PCProjectManager.m @@ -722,6 +722,8 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange"; NSString *category = [[project projectBrowser] nameOfSelectedCategory]; NSString *categoryKey = [activeProject keyForCategory:category]; NSMutableArray *files = nil; + NSString *path = nil; + NSRange pathRange; files = [fileManager filesForAdd]; @@ -734,8 +736,18 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange"; return NO; } - // Copy and add files - [activeProject addAndCopyFiles:files forKey:categoryKey]; + path = [[files objectAtIndex:0] stringByDeletingLastPathComponent]; + pathRange = [path rangeOfString:[activeProject projectPath]]; + + if (pathRange.length) + { + [activeProject addFiles:files forKey:categoryKey notify:YES]; + } + else + { + // Copy and add files + [activeProject addAndCopyFiles:files forKey:categoryKey]; + } return YES; }