* EOAccess/EOModelGroup.m ([+globalModelGroup]): Search for

.eomodel files as well and call -addModelWithFile: with full
        path.
        * EOAccess/EOModel.m ([-initWithContentsOfFile:]): Add assert
        if file could not be read.

        * EOControl/EOKeyGlobalID.m ([-hash]): Improve quality of hash
        values.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20294 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Ayers 2004-11-04 11:08:10 +00:00
parent aad84f842f
commit 2f6232368a
4 changed files with 23 additions and 7 deletions

View file

@ -1,3 +1,14 @@
2004-11-04 David Ayers <d.ayers@inode.at>
* EOAccess/EOModelGroup.m ([+globalModelGroup]): Search for
.eomodel files as well and call -addModelWithFile: with full
path.
* EOAccess/EOModel.m ([-initWithContentsOfFile:]): Add assert
if file could not be read.
* EOControl/EOKeyGlobalID.m ([-hash]): Improve quality of hash
values.
2004-11-03 David Ayers <d.ayers@inode.at>
* EOAccess/EOAdaptorContext.h: Only use ASCII characters.

View file

@ -579,6 +579,7 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
}
fileContents = [NSString stringWithContentsOfFile: indexPath];
NSAssert1(fileContents!=nil, @"File %@ could not be read.", indexPath);
propList = [fileContents propertyList];
EOFLOGObjectLevelArgs(@"gsdb", @"propList=%@", propList);
NSAssert1(propList!=nil, @"Model at path %@ is invalid", indexPath);

View file

@ -123,10 +123,11 @@ static EOModelGroup *globalModelGroup = nil;
{
NSMutableArray *bundles = [NSMutableArray arrayWithCapacity: 2];
NSBundle *bundle = nil;
NSArray *paths = nil;
NSMutableArray *paths = nil;
NSEnumerator *pathsEnum = nil;
NSEnumerator *bundleEnum = nil;
NSString *path = nil;
id tmp;
globalModelGroup = [EOModelGroup new];
@ -138,8 +139,13 @@ static EOModelGroup *globalModelGroup = nil;
bundleEnum = [bundles objectEnumerator];
while ((bundle = [bundleEnum nextObject]))
{
paths = [bundle pathsForResourcesOfType: @"eomodeld"
inDirectory: nil];
paths = (id)[NSMutableArray array];
tmp = [bundle pathsForResourcesOfType: @"eomodeld"
inDirectory: nil];
[paths addObjectsFromArray: tmp];
tmp = [bundle pathsForResourcesOfType: @"eomodel"
inDirectory: nil];
[paths addObjectsFromArray: tmp];
if (!paths)
{
@ -150,8 +156,6 @@ static EOModelGroup *globalModelGroup = nil;
pathsEnum = [paths objectEnumerator];
while ((path = [pathsEnum nextObject]))
{
path = [path stringByDeletingPathExtension];
NSLog(@"%@", path);
[globalModelGroup addModelWithFile: path];
}
}

View file

@ -150,9 +150,9 @@ RCS_ID("$Id$")
unsigned int hash = 0;
for (i = 0; i < _keyCount; i++)
hash += [_keyValues[i] hash];
hash ^= [_keyValues[i] hash];
hash += [_entityName hash];
hash ^= [_entityName hash];
return hash;
}