* dev-apps/test/Testsuite/gdl2/GDL2Testing.h: Include ObjectTesting.h instead of stuff.h.

* dev-apps/test/Testsuite/gdl2/EOModel/test05.m: New test for -removeEntity:.

* dev-libs/gdl2/EOAccess/EOEntity.m (-_setModel:): Accept nil argument, comment.
* dev-libs/gdl2/EOAccess/EOModel.m (-removeEntity:): Comment.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@21321 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Matt Rice 2005-06-17 14:46:37 +00:00
parent 44d8935e49
commit 4ba78b33b4
3 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2005-06-17 Matt Rice <ratmice@yahoo.com>
* EOAccess/EOEntity.m (-_setModel:): Accept nil argument, comment.
* EOAccess/EOModel.m (-removeEntity:): Comment.
2005-05-18 Matt Rice <ratmice@yahoo.com>
* EOControl/EOObserver.m (EOObserverCenter): Don't retain observers.

View file

@ -2607,6 +2607,13 @@ createInstanceWithEditingContext:globalID:zone:
return _flags.createsMutableObjects;
}
/* throws an exception if _model is not nil, and the model argument is not
* identical to the _model ivar. As a special case EOModel -removeEntity:
* is allowed to call this with a nil model, but removeEntity: is responsible
* for any bookeeping.
*
* in other words, this method should not be used to change an entity's model.
*/
- (void)_setModel: (EOModel *)model
{
EOFLOGObjectLevelArgs(@"EOEntity", @"setModel=%p", model);
@ -2619,7 +2626,7 @@ createInstanceWithEditingContext:globalID:zone:
[_attributesToFetch class],
_attributesToFetch);
NSAssert3((_model == nil || _model == model),
NSAssert3((_model == nil || _model == model || model == nil),
@"Attempt to set entity: %@ owned by model: %@ to model: @%.",
[self name], [_model name], [model name]);

View file

@ -1506,6 +1506,7 @@ NSString *EOEntityLoadedNotification = @"EOEntityLoadedNotification";
{
NSString *className = nil;
/* as a special case this method can call _setModel: with nil */
[entity _setModel: nil];
[_entitiesByName removeObjectForKey: [entity name]];