mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-27 00:50:44 +00:00
Adding logic for .gorm file directories
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@14892 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
89ef1d72c9
commit
00c2564afb
2 changed files with 53 additions and 27 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2002-10-31 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
|
* Source/NSBundleAdditions.m:
|
||||||
|
+[loadNibFile:externalNameTable:withZone:]: Added logic
|
||||||
|
to load .gorm directories and also maintained backwards compatibility
|
||||||
|
with .gorm files.
|
||||||
|
|
||||||
2002-10-29 Pierre-Yves Rivaille <pyrivail@ens-lyon.fr>
|
2002-10-29 Pierre-Yves Rivaille <pyrivail@ens-lyon.fr>
|
||||||
|
|
||||||
* Source/NSSplitView.m ([NSSplitView -resizeSubviewsWithOldSize:]):
|
* Source/NSSplitView.m ([NSSplitView -resizeSubviewsWithOldSize:]):
|
||||||
|
|
|
@ -259,8 +259,26 @@ Class gmodel_class(void)
|
||||||
NSDebugLog(@"Loading Nib `%@'...\n", fileName);
|
NSDebugLog(@"Loading Nib `%@'...\n", fileName);
|
||||||
NS_DURING
|
NS_DURING
|
||||||
{
|
{
|
||||||
NSData *data = [NSData dataWithContentsOfFile: fileName];
|
NSFileManager *mgr = [NSFileManager defaultManager];
|
||||||
NSDebugLog(@"Loaded data...");
|
BOOL isDir = NO;
|
||||||
|
|
||||||
|
if([mgr fileExistsAtPath: fileName isDirectory: &isDir])
|
||||||
|
{
|
||||||
|
NSData *data = nil;
|
||||||
|
|
||||||
|
// if the data is in a directory, then load from objects.gorm in the directory
|
||||||
|
if(isDir == NO)
|
||||||
|
{
|
||||||
|
data = [NSData dataWithContentsOfFile: fileName];
|
||||||
|
NSDebugLog(@"Loaded data from file...");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NSString *newFileName = [fileName stringByAppendingPathComponent: @"objects.gorm"];
|
||||||
|
data = [NSData dataWithContentsOfFile: newFileName];
|
||||||
|
NSDebugLog(@"Loaded data from %@...",newFileName);
|
||||||
|
}
|
||||||
|
|
||||||
if (data != nil)
|
if (data != nil)
|
||||||
{
|
{
|
||||||
unarchiver = [[NSUnarchiver alloc] initForReadingWithData: data];
|
unarchiver = [[NSUnarchiver alloc] initForReadingWithData: data];
|
||||||
|
@ -294,6 +312,7 @@ Class gmodel_class(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
{
|
{
|
||||||
NSLog(@"Exception occured while loading model: %@",[localException reason]);
|
NSLog(@"Exception occured while loading model: %@",[localException reason]);
|
||||||
|
|
Loading…
Reference in a new issue