Corrected a core dump in GormDocument when saving class files.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@15058 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2002-11-23 22:52:27 +00:00
parent da8436ae2d
commit b6b823e15f
2 changed files with 21 additions and 23 deletions

View file

@ -1,3 +1,10 @@
2002-11-22 Gregory John Casamento <greg_casamento@yahoo.com>
* GormDocument.m: -[GormDocument createClassFiles:] fixed problem
which was getting the classname from the currently selected row in
the classesView. It now calls -[GormOutlineView itemBeingEdited] to
get the class being edited.
2002-11-22 Gregory John Casamento <greg_casamento@yahoo.com>
* GormDocument.[hm]: added -[GormDocument removeConnectionsWithLabel:

View file

@ -4,7 +4,9 @@
*
* Author: Richard Frith-Macdonald <richard@brainstrom.co.uk>
* Date: 1999
*
* Author: Gregory John Casamento <greg_casamento@yahoo.com>
* Date: 2002
*
* This file is part of GNUstep.
*
* This program is free software; you can redistribute it and/or modify
@ -925,20 +927,12 @@ static NSImage *classesImage = nil;
- (id) createClassFiles: (id)sender
{
NSSavePanel *sp;
NSString *className;
int row = [classesView selectedRow];
NSString *className = [classesView itemBeingEdited];
int result;
// if no selection, just return.
if(row == -1)
{
return self;
}
sp = [NSSavePanel savePanel];
[sp setRequiredFileType: @"m"];
[sp setTitle: @"Save source file as..."];
className = [classesView itemAtRow: row];
if (documentPath == nil)
result = [sp runModalForDirectory: NSHomeDirectory()
file: [className stringByAppendingPathExtension: @"m"]];
@ -963,20 +957,17 @@ static NSImage *classesImage = nil;
if (result == NSOKButton)
{
headerName = [sp filename];
if (row >= 0)
NSLog(@"Saving %@",className);
if (![classManager makeSourceAndHeaderFilesForClass: className
withName: sourceName
and: headerName])
{
NSLog([classesView itemAtRow: row]);
if (![classManager makeSourceAndHeaderFilesForClass: className
withName: sourceName
and: headerName])
{
NSRunAlertPanel(@"Alert",
@"Could not create the class's file",
nil, nil, nil);
}
return self;
NSRunAlertPanel(@"Alert",
@"Could not create the class's file",
nil, nil, nil);
}
return self;
}
}
return nil;