* EOAccess/EOEntity.m (-[setName:]): Skip the uniqueing if the

name is the same.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20152 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Ayers 2004-09-26 21:30:02 +00:00
parent 697a6f33bf
commit ffb14dffe8
2 changed files with 17 additions and 7 deletions

View file

@ -18,6 +18,9 @@
(-[EOObserverProxy initWithTarget:action:priority:]): Implement.
(-[EOObserverProxy dealloc],-[EOObserverProxy priority])
(-[EOObserverProxy subjectChanged]): Ditto.
* EOAccess/EOEntity.m (-[setName:]): Skip the uniqueing if the
name is the same.
2004-09-25 David Ayers <d.ayers@inode.at>

View file

@ -1874,14 +1874,21 @@ createInstanceWithEditingContext:globalID:zone:
- (void)setName: (NSString *)name
{
if ([_model entityNamed: name])
[NSException raise: NSInvalidArgumentException
format: @"%@ -- %@ 0x%x: \"%@\" already used in the model",
NSStringFromSelector(_cmd),
NSStringFromClass([self class]),
self,
name];
if (name && [name isEqual: _name]) return;
if (name
&& [name isEqual: _name] == NO
&& [_model entityNamed: name] != nil)
{
[NSException raise: NSInvalidArgumentException
format: @"%@ -- %@ 0x%x: \"%@\" already used in the model",
NSStringFromSelector(_cmd),
NSStringFromClass([self class]),
self,
name];
}
[self willChange];
ASSIGNCOPY(_name, name);
[_model _updateCache];
}