Do not launch replacing if copying was not successful, avoids hang of app.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@37123 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2013-09-20 09:17:55 +00:00
parent d7830b79c8
commit 567dbdeb5b
2 changed files with 16 additions and 11 deletions

View file

@ -1,4 +1,9 @@
2013-09-17 Riccardo Mottola <rm@gnustep.org>
2013-09-20 Riccardo Mottola <rm@gnu.org>
* Framework/PCFileCreator.m
Do not launch replacing if copying was not successful, avoids hang of app.
2013-09-17 Riccardo Mottola <rm@gnu.org>
* Modules/Projects/ResourceSet/PCResourceSetProject.m
Replace deprecated make variable.

View file

@ -1,10 +1,11 @@
/*
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
Copyright (C) 2001-2004 Free Software Foundation
Copyright (C) 2001-2013 Free Software Foundation
Authors: Philippe C.D. Robert
Serg Stoyan
Riccardo Mottola
This file is part of GNUstep.
@ -249,11 +250,13 @@ static NSDictionary *dict = nil;
key = [fileType objectForKey:@"ProjectKey"];
template = [fileType objectForKey:@"TemplateFile"];
[pcfm copyFile:template toFile:newFile];
[self replaceTagsInFileAtPath:newFile withProject:aProject];
[aProject addFiles:[NSArray arrayWithObject:newFile]
forKey:key
notify:YES];
if ([pcfm copyFile:template toFile:newFile])
{
[self replaceTagsInFileAtPath:newFile withProject:aProject];
[aProject addFiles:[NSArray arrayWithObject:newFile]
forKey:key
notify:YES];
}
}
// Notify the browser!
@ -319,7 +322,7 @@ static NSDictionary *dict = nil;
}
[file writeToFile:newFile atomically:YES];
[file autorelease];
[file release];
}
@end
@ -440,9 +443,6 @@ static NSDictionary *dict = nil;
NSFileManager *fm = [NSFileManager defaultManager];
BOOL complementary;
/* NSLog(@"PCFileCreator: [createFile] %@ in category: %@",
fileName, projectKey);*/
path = [[activeProject projectPath] stringByAppendingPathComponent:fileName];
// Create file
if (path)