Single click always invokes the internal editor now.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@12614 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Philippe C.D. Robert 2002-02-21 10:15:17 +00:00
parent 4ee31e2a7c
commit 6b2f8c69f7
3 changed files with 24 additions and 18 deletions

View file

@ -42,6 +42,7 @@
- (void)setProject:(PCProject *)aProject; - (void)setProject:(PCProject *)aProject;
- (PCEditor *)internalEditorForFile:(NSString *)path;
- (PCEditor *)editorForFile:(NSString *)path; - (PCEditor *)editorForFile:(NSString *)path;
- (NSArray *)allEditors; - (NSArray *)allEditors;

View file

@ -79,6 +79,27 @@
project = aProject; project = aProject;
} }
- (PCEditor *)internalEditorForFile:(NSString *)path
{
PCEditor *editor;
if( editor = [editorDict objectForKey:path] )
{
return editor;
}
else
{
editor = [[PCEditor alloc] initWithPath:path];
[editor setDelegate:self];
[editorDict setObject:editor forKey:path];
//RELEASE(editor);
return editor;
}
}
- (PCEditor *)editorForFile:(NSString *)path - (PCEditor *)editorForFile:(NSString *)path
{ {
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
@ -89,23 +110,7 @@
} }
else else
{ {
PCEditor *editor; [self internalEditorForFile:path];
if( editor = [editorDict objectForKey:path] )
{
return editor;
}
else
{
editor = [[PCEditor alloc] initWithPath:path];
[editor setDelegate:self];
[editorDict setObject:editor forKey:path];
//RELEASE(editor);
return editor;
}
} }
} }

View file

@ -646,7 +646,7 @@
[fileNameField setStringValue:fileName]; [fileNameField setStringValue:fileName];
// Show the file in the internal editor! // Show the file in the internal editor!
e = [editorController editorForFile:p]; e = [editorController internalEditorForFile:p];
if( e == nil ) if( e == nil )
{ {