mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-03-14 06:31:31 +00:00
If we have a directory, we check if it is a bundle that an app can open it and open it through NSWorkspace
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@38631 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
94538f96d0
commit
f46b6e594a
2 changed files with 16 additions and 1 deletions
|
@ -3,6 +3,9 @@
|
|||
* Framework/PCProjectEditor.m
|
||||
Re-enable wrongly uncommented statement.
|
||||
|
||||
* Framework/PCEditorManager.m
|
||||
If we have a directory, we check if it is a bundle that an app can open it and open it through NSWorkspace.
|
||||
|
||||
2015-06-12 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditor.m
|
||||
|
|
|
@ -191,15 +191,27 @@ NSString *PCEditorDidResignActiveNotification =
|
|||
@"Couldn't open editor for file '%@'.\n"
|
||||
@"File is not plain text.",
|
||||
@"Close", nil, nil, filePath);*/
|
||||
PCLogInfo(self, @"Not a text file %@", filePath);
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *app;
|
||||
|
||||
/* Check for bundles and if possible let them be opened by Workspace */
|
||||
app = [[NSWorkspace sharedWorkspace] getBestAppInRole:@"Editor" forExtension:[fileName pathExtension]];
|
||||
if (app)
|
||||
{
|
||||
if ([[NSWorkspace sharedWorkspace] openFile: filePath])
|
||||
return nil;
|
||||
}
|
||||
}
|
||||
|
||||
// NSLog(@"EditorManager 1: %@", _editorsDict);
|
||||
editor = [_editorsDict objectForKey: filePath];
|
||||
if (editor == nil)
|
||||
{
|
||||
NSLog(@"Opening new editor. Editor: %@", editorName);
|
||||
// Editor
|
||||
editor = [bundleManager objectForBundleWithName:editorName
|
||||
type:@"editor"
|
||||
|
|
Loading…
Reference in a new issue