Try to detect spaces in paths and warn users if they create projects with spaces in paths, and follow the official recommendations of not setting GNUSTEP_INSTALLATION_DOMAIN unless a particular one needs to be specified

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@28696 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2009-09-17 09:05:45 +00:00
parent 524a2e7ceb
commit a2e0ccf011
3 changed files with 55 additions and 2 deletions

View file

@ -1,4 +1,20 @@
2009-09-15 Richard frith-Macdonald <rfm"gnu.org>
2009-09-17 Nicola Pero <nicola.pero@meta-innovation.com>
* Framework/PCMakefileFactory.m ([-createMakefileForProject:]): If
GNUSTEP_INSTALLATION_DOMAIN is not set, output a commented out
GNUSTEP_INSTALLATION_DOMAIN line so that the default is used but
people will still find out that the option exists if they look at
the file.
2009-09-17 Nicola Pero <nicola.pero@meta-innovation.com>
Old patch from Markus Hitter <mah@jump-ing.de>, updated to the
current code:
* Framework/PCProjectManager.m ([-openProjectAt:makeActive:]): Pop
up a warning panel if the project path includes a whitespace.
([-newProject]): Same change.
2009-09-15 Richard frith-Macdonald <rfm@gnu.org>
* Framework/PCMakefileFactory.m: generate makefiles with standard
preamble to determine GNUSTEP_MAKEFILES if possible, and warn if

View file

@ -101,8 +101,15 @@ static PCMakefileFactory *_factory = nil;
}
else if ([instDir isEqualToString: @""])
{
/* This should not be specified; gnustep-make will use the
* default - normally, but not necessarily, LOCAL.
* We output a commented line here so that people looking
* at the file will know that this option exists, and
* if they want to change it, will search for it in
* ProjectCenter.
*/
[mfile appendString:
[NSString stringWithFormat: @"\nGNUSTEP_INSTALLATION_DOMAIN = LOCAL\n",
[NSString stringWithFormat: @"\n# GNUSTEP_INSTALLATION_DOMAIN = LOCAL\n",
instDir]];
}

View file

@ -558,6 +558,21 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
return nil;
}
if ([aPath rangeOfString: @" "] != NSNotFound ||
[aPath rangeOfString: @"\t"] != NSNotFound ||
[aPath rangeOfString: @"\r"] != NSNotFound ||
[aPath rangeOfString: @"\n"] != NSNotFound)
{
if (NSRunAlertPanel
(@"Open Project",
@"Are you sure you want to open a project with whitespace in it's path?\n"
@"GNUstep's build environment currently can't handle that reliably.",
@"OK", @"Cancel", nil) != NSAlertDefaultReturn)
{
return nil;
}
}
if (!isDir)
{
projectFile = [NSMutableDictionary dictionaryWithContentsOfFile: aPath];
@ -744,6 +759,21 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
filePath = [files objectAtIndex:0];
if (filePath != nil)
{
if ([filePath rangeOfString: @" "] != NSNotFound ||
[filePath rangeOfString: @"\t"] != NSNotFound ||
[filePath rangeOfString: @"\r"] != NSNotFound ||
[filePath rangeOfString: @"\n"] != NSNotFound)
{
if (NSRunAlertPanel
(@"New Project",
@"Are you sure you want to create a project with whitespace in it's path?\n"
@"GNUstep's build environment currently can't handle that reliably.",
@"OK", @"Cancel", nil) != NSAlertDefaultReturn)
{
return;
}
}
projectType = [projectTypePopup titleOfSelectedItem];
if (!(project = [self createProjectOfType:projectType path:filePath]))