mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-03-14 06:31:31 +00:00
Use the internal editor if it is available, even if no parser is available
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@38622 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5abf1258c2
commit
ebe3320d03
1 changed files with 26 additions and 26 deletions
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
|
||||
|
||||
Copyright (C) 2002-2014 Free Software Foundation
|
||||
Copyright (C) 2002-2015 Free Software Foundation
|
||||
|
||||
Authors: Philippe C.D. Robert
|
||||
Serg Stoyan
|
||||
|
@ -210,33 +210,33 @@ NSString *PCEditorDidResignActiveNotification =
|
|||
objectForBundleWithName:@"ProjectCenter"
|
||||
type:@"editor"
|
||||
protocol:@protocol(CodeEditor)];
|
||||
if (editor == nil)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
// Parser
|
||||
parser = [bundleManager objectForBundleType:@"parser"
|
||||
protocol:@protocol(CodeParser)
|
||||
fileName:fileName];
|
||||
if(parser != nil)
|
||||
{
|
||||
[editor setParser:parser];
|
||||
[editor openFileAtPath:filePath
|
||||
editorManager:self
|
||||
editable:editable];
|
||||
[_editorsDict setObject:editor forKey:filePath];
|
||||
RELEASE(editor);
|
||||
}
|
||||
|
||||
/* if we have a valid editor, we try to set a parser */
|
||||
if (editor)
|
||||
{
|
||||
// Parser
|
||||
parser = [bundleManager objectForBundleType:@"parser"
|
||||
protocol:@protocol(CodeParser)
|
||||
fileName:fileName];
|
||||
if(parser != nil)
|
||||
{
|
||||
[editor setParser:parser];
|
||||
}
|
||||
[editor openFileAtPath:filePath
|
||||
editorManager:self
|
||||
editable:editable];
|
||||
[_editorsDict setObject:editor forKey:filePath];
|
||||
RELEASE(editor);
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// If we don't have an editor or a parser, we fall back to opening the
|
||||
// file with the editor designated by the system.
|
||||
//
|
||||
[[NSWorkspace sharedWorkspace] openFile: filePath];
|
||||
}
|
||||
{
|
||||
//
|
||||
// If we don't have an editor, we fall back to opening the
|
||||
// file with the editor designated by the system.
|
||||
//
|
||||
[[NSWorkspace sharedWorkspace] openFile: filePath];
|
||||
}
|
||||
}
|
||||
|
||||
if(editor != nil)
|
||||
|
|
Loading…
Reference in a new issue