Author: rmottola
Date: Fri Jun 12 11:00:40 2015
New Revision: 38622
URL: http://svn.gna.org/viewcvs/gnustep?rev=38622&view=rev
Log:
Use the internal editor if it is available, even if no parser is available
Modified:
apps/projectcenter/trunk/Framework/PCEditorManager.m
Modified: apps/projectcenter/trunk/Framework/PCEditorManager.m
URL:
http://svn.gna.org/viewcvs/gnustep/apps/projectcenter/trunk/Framework/PCEditorManager.m?rev=38622&r1=38621&r2=38622&view=diff
==============================================================================
--- apps/projectcenter/trunk/Framework/PCEditorManager.m (original)
+++ apps/projectcenter/trunk/Framework/PCEditorManager.m Fri Jun 12
11:00:40 2015
@@ -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 @@
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)
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs