mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 03:00:47 +00:00
* Source/NSDocument.m ([NSDocument -init]): Check the count of the
types array and uses Viewer and Editor NSRoles to set the default type. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17485 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a5621a25e4
commit
a3113ee753
3 changed files with 12 additions and 2 deletions
|
@ -63,15 +63,20 @@
|
|||
- (id) init
|
||||
{
|
||||
static int untitledCount = 1;
|
||||
NSArray *fileTypes;
|
||||
|
||||
self = [super init];
|
||||
if (self != nil)
|
||||
{
|
||||
_documentIndex = untitledCount++;
|
||||
_windowControllers = [[NSMutableArray alloc] init];
|
||||
fileTypes = [[self class] readableTypes];
|
||||
|
||||
/* Set our default type */
|
||||
[self setFileType: [[[self class] writableTypes] objectAtIndex: 0]];
|
||||
if ([fileTypes count])
|
||||
{
|
||||
[self setFileType: [fileTypes objectAtIndex: 0]];
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue