Fixed 2 bugs which caused a severe crash.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@12551 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Philippe C.D. Robert 2002-02-17 13:14:51 +00:00
parent e07767053f
commit bae1bafa98
6 changed files with 16 additions and 16 deletions

View file

@ -219,8 +219,8 @@ NSString *PCEditorDidResignKeyNotification=@"PCEditorDidResignKeyNotification";
}
ret = NSRunAlertPanel(@"Edited File!",
@"Should the file be saved before closing?",
@"Yes",@"No",nil);
@"Should '%@' be saved before closing?",
@"Yes",@"No",nil,path);
if( ret == YES )
{
@ -234,7 +234,7 @@ NSString *PCEditorDidResignKeyNotification=@"PCEditorDidResignKeyNotification";
}
}
[window setDocumentEdited:NO];
[self setIsEdited:NO];
}
if( delegate && [delegate respondsToSelector:@selector(editorDidClose:)] )

View file

@ -64,6 +64,7 @@
- (void)dealloc
{
[editorDict removeAllObjects];
RELEASE( editorDict );
[super dealloc];
@ -122,7 +123,6 @@
while(( key = [enumerator nextObject] ))
{
editor = [editorDict objectForKey:key];
[editor close];
[[editor editorWindow] performClose:self];
}

View file

@ -404,6 +404,7 @@ static BOOL isInitialised = NO;
- (void)keyDown:(NSEvent *)anEvent
{
/*
NSString *chars = [anEvent charactersIgnoringModifiers];
int modifiers = [anEvent modifierFlags];
@ -412,6 +413,7 @@ static BOOL isInitialised = NO;
[editor saveFile];
return;
}
*/
[super keyDown:anEvent];
}

View file

@ -447,9 +447,9 @@
RELEASE(projectDict);
RELEASE(projectManager);
if( projectBuilder) RELEASE(projectBuilder);
if( projectBuilder) RELEASE(projectBuilder);
if( projectDebugger) RELEASE(projectDebugger);
if( projectEditor) RELEASE(projectEditor);
if( projectEditor) RELEASE(projectEditor);
RELEASE(browserController);
RELEASE(projectWindow);
@ -1177,10 +1177,7 @@
{
id object = [aNotification object];
if (object == buildTargetPanel)
{
}
else if (object == [self projectWindow])
if (object == [self projectWindow])
{
if ([[self projectWindow] isDocumentEdited])
{
@ -1193,7 +1190,10 @@
}
[editorController closeAllEditors];
// HACK to avoid crash upon close...
[self showBuildView:self];
// The PCProjectController is our delegate!
[[NSNotificationCenter defaultCenter] removeObserver:browserController];
[projectManager closeProject:self];

View file

@ -89,7 +89,7 @@
- (void)dealloc
{
RELEASE(componentView);
if( componentView ) RELEASE(componentView);
[super dealloc];
}
@ -109,11 +109,9 @@
NSRect frame;
editor = ev;
frame = [[scrollView contentView] frame];
[scrollView setDocumentView:editor];
frame = [[scrollView contentView] frame];
frame.size = NSMakeSize([scrollView contentSize].width,1e7);
[[editor textContainer] setContainerSize:frame.size];

View file

@ -473,7 +473,7 @@ NSString *ActiveProjectDidChangeNotification = @"ActiveProjectDidChange";
{
return;
}
// Remove it from the loaded projects!
[loadedProjects removeObjectForKey:key];
[self setActiveProject:[[loadedProjects allValues] lastObject]];