mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-22 12:55:44 +00:00
* EOControl/EOEditingContext.m (_globalIDChanged:): Make
assert more accurate. (-_invalidatedAllObjectsInStore:): Implement. (+setUsesContextRelativeEncoding:): Implement. (+usesContextRelativeEncoding): Implement. (+initialize): Set default value of usesContextRelativeEncoding depending on whether we are a gsweb application. * EOControl/EOObjectStoreCoordinator.m (_invalidatedAllObjectsInSubStore:): Implement. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@20682 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4567f958cd
commit
0c617ef38a
3 changed files with 57 additions and 16 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
2005-02-10 David Ayers <d.ayers@inode.at>
|
||||
|
||||
* EOControl/EOEditingContext.m (_globalIDChanged:): Make assert
|
||||
more accurate.
|
||||
(-_invalidatedAllObjectsInStore:): Implement.
|
||||
(+setUsesContextRelativeEncoding:): Implement.
|
||||
(+usesContextRelativeEncoding): Implement.
|
||||
(+initialize): Set default value of usesContextRelativeEncoding
|
||||
depending on whether we are a gsweb application.
|
||||
|
||||
* EOControl/EOObjectStoreCoordinator.m
|
||||
(_invalidatedAllObjectsInSubStore:): Implement.
|
||||
|
||||
2005-02-08 Matt Rice <ratmice@yahoo.com>
|
||||
|
||||
* EOControl/EOEditingContext.m (-_globalIDChanged:): Add key
|
||||
|
|
|
@ -227,10 +227,15 @@ _mergeValueForKey(id obj, id value,
|
|||
{
|
||||
if (self == [EOEditingContext class] && defaultParentStore == nil)
|
||||
{
|
||||
BOOL gswapp;
|
||||
|
||||
defaultParentStore = [EOObjectStoreCoordinator defaultCoordinator];
|
||||
null = [EONull null];
|
||||
EOEditingContextClass = self;
|
||||
EOAssociationClass = NSClassFromString(@"EOAssociation");
|
||||
gswapp = (NSClassFromString(@"GSWApplication") != nil
|
||||
|| NSClassFromString(@"WOApplication") != nil);
|
||||
[self setUsesContextRelativeEncoding: gswapp];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -801,7 +806,8 @@ _mergeValueForKey(id obj, id value,
|
|||
|
||||
if (snapshot)
|
||||
{
|
||||
NSAssert(gid != tempGID, @"gid and temporary gid are the same");
|
||||
NSAssert2([gid isEqual: tempGID] == NO,
|
||||
@"gid %@ and temporary gid %@ are equal", gid, tempGID);
|
||||
[_snapshotsByGID setObject: snapshot
|
||||
forKey: gid];
|
||||
[_snapshotsByGID removeObjectForKey: tempGID];
|
||||
|
@ -924,16 +930,23 @@ _mergeValueForKey(id obj, id value,
|
|||
gids = NSAllMapTableKeys(_objectsByGID);
|
||||
[_objectStore invalidateObjectsWithGlobalIDs: gids];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName: EOInvalidatedAllObjectsInStoreNotification
|
||||
object: self
|
||||
userInfo: nil];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName: EOInvalidatedAllObjectsInStoreNotification
|
||||
object: self
|
||||
userInfo: nil];
|
||||
}
|
||||
|
||||
//"Receive ???? notification"
|
||||
- (void) _invalidatedAllObjectsInStore: (NSNotification*)notification
|
||||
- (void)_invalidatedAllObjectsInStore: (NSNotification*)notification
|
||||
{
|
||||
NSEmitTODO();
|
||||
[self notImplemented: _cmd]; //TODO
|
||||
if ([notification object] == _objectStore)
|
||||
{
|
||||
[self _sendOrEnqueueNotification: notification
|
||||
selector: @selector(_resetAllChanges:)];
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName: EOInvalidatedAllObjectsInStoreNotification
|
||||
object: self
|
||||
userInfo: nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) _forgetObjectWithGlobalID:(EOGlobalID*)gid
|
||||
|
@ -3313,16 +3326,15 @@ shouldContinueFetchingWithCurrentObjectCount: (unsigned)count
|
|||
@end
|
||||
|
||||
@implementation EOEditingContext (EOStateArchiving)
|
||||
|
||||
+ (void)setUsesContextRelativeEncoding: (BOOL)yn
|
||||
static BOOL usesContextRelativeEncoding = NO;
|
||||
+ (void)setUsesContextRelativeEncoding: (BOOL)flag
|
||||
{
|
||||
[self notImplemented: _cmd]; //TODO
|
||||
usesContextRelativeEncoding = flag ? YES : NO;
|
||||
}
|
||||
|
||||
+ (BOOL)usesContextRelativeEncoding
|
||||
{
|
||||
[self notImplemented: _cmd]; //TODO
|
||||
return NO;
|
||||
return usesContextRelativeEncoding;
|
||||
}
|
||||
|
||||
+ (void)encodeObject: (id)object
|
||||
|
|
|
@ -460,21 +460,37 @@ NSString *EOCooperatingObjectStoreNeeded = @"EOCooperatingObjectStoreNeeded";
|
|||
editingContext: context];
|
||||
}
|
||||
|
||||
/*
|
||||
* If there is only one store that we are coordinating then all our
|
||||
* objects were also invalidated.
|
||||
*/
|
||||
- (void) _invalidatedAllObjectsInSubStore: (NSNotification*)notification
|
||||
{
|
||||
[self notImplemented: _cmd]; //TODO
|
||||
if ([_stores count] == 1)
|
||||
{
|
||||
NSAssert2([_stores containsObject: [notification object]],
|
||||
@"recived notification %@ for foreign store %@",
|
||||
notification, _stores);
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName: EOInvalidatedAllObjectsInStoreNotification
|
||||
object: self
|
||||
userInfo: nil];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Let the EOEditingContexts know that some objects changed.
|
||||
*/
|
||||
- (void) _objectsChangedInSubStore: (NSNotification*)notification
|
||||
{
|
||||
EOFLOGObjectFnStart(); //TODO
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
if ([notification object] != self)
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName: EOObjectsChangedInStoreNotification
|
||||
object: self
|
||||
userInfo: [notification userInfo]]; //call _objectsChangedInStore: # EditingContext
|
||||
userInfo: [notification userInfo]];
|
||||
}
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
|
|
Loading…
Reference in a new issue