Adding files to project fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@19675 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Sergii Stoian 2004-07-03 13:30:04 +00:00
parent 6781fde41f
commit a47c8aa7b8
3 changed files with 31 additions and 7 deletions

View file

@ -1,3 +1,13 @@
2004-07-03 Serg Stoyan <stoyan255@ukr.net>
* 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 <stoyan255@ukr.net>
* 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 <stoyan255@ukr.net>

View file

@ -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

View file

@ -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;
}