mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 09:21:53 +00:00
Extracted new method [pathForNibResource:] for NSWindowController.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11545 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e9e500d310
commit
afed87226a
1 changed files with 18 additions and 10 deletions
|
@ -314,9 +314,7 @@ Class gmodel_class(void)
|
||||||
withZone: [owner zone]];
|
withZone: [owner zone]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) loadNibFile: (NSString*)fileName
|
- (NSString *) pathForNibResource: (NSString *)fileName
|
||||||
externalNameTable: (NSDictionary*)context
|
|
||||||
withZone: (NSZone*)zone
|
|
||||||
{
|
{
|
||||||
NSFileManager *mgr = [NSFileManager defaultManager];
|
NSFileManager *mgr = [NSFileManager defaultManager];
|
||||||
NSMutableArray *array = [NSMutableArray arrayWithCapacity: 8];
|
NSMutableArray *array = [NSMutableArray arrayWithCapacity: 8];
|
||||||
|
@ -378,23 +376,33 @@ Class gmodel_class(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return [NSBundle loadNibFile: path
|
return path;
|
||||||
externalNameTable: context
|
|
||||||
withZone: (NSZone*)zone];
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
path = [rootPath stringByAppendingPathExtension: ext];
|
path = [rootPath stringByAppendingPathExtension: ext];
|
||||||
if([mgr isReadableFileAtPath: path])
|
if([mgr isReadableFileAtPath: path])
|
||||||
{
|
{
|
||||||
return [NSBundle loadNibFile: path
|
return path;
|
||||||
externalNameTable: context
|
|
||||||
withZone: (NSZone*)zone];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NO;
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) loadNibFile: (NSString*)fileName
|
||||||
|
externalNameTable: (NSDictionary*)context
|
||||||
|
withZone: (NSZone*)zone
|
||||||
|
{
|
||||||
|
NSString *path = [self pathForNibResource: fileName];
|
||||||
|
|
||||||
|
if (path != nil)
|
||||||
|
return [NSBundle loadNibFile: path
|
||||||
|
externalNameTable: context
|
||||||
|
withZone: (NSZone*)zone];
|
||||||
|
else
|
||||||
|
return NO;
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue