oc: Set right container in dbFolder when moving a folder

The path attribute from SOGoCacheGCSFolder is properly updated
in the database but not when returning from path message as
the container is the old one.
pull/69/head
Enrique J. Hernández Blasco 2015-01-28 11:26:56 +01:00
parent 2dcb8fa732
commit 57d591c427
5 changed files with 16 additions and 2 deletions

View File

@ -152,7 +152,8 @@ static NSString *MAPIStoreRightFolderContact = @"RightsFolderContact";
targetPath = [[targetFolder sogoObject] path];
newPath = [NSString stringWithFormat: @"%@/%@",
targetPath, pathComponent];
[dbFolder changePathTo: newPath];
[dbFolder changePathTo: newPath
intoNewContainer: [targetFolder dbFolder]];
mapping = [self mapping];
newURL = [NSString stringWithFormat: @"%@%@/",

View File

@ -1286,7 +1286,8 @@ _parseCOPYUID (NSString *line, NSArray **destUIDsP)
[dbFolder changePathTo: [NSString stringWithFormat:
@"%@/folder%@",
parentDBFolderPath,
newFolderDBName]];
newFolderDBName]
intoNewContainer: [targetFolder dbFolder]];
}
}
else

View File

@ -49,6 +49,8 @@
andSortOrderings: (NSArray *) sortOrderings;
- (void) changePathTo: (NSString *) newPath;
- (void) changePathTo: (NSString *) newPath
intoNewContainer: (id) newContainer;
@end

View File

@ -308,6 +308,14 @@ Class SOGoCacheGCSObjectK = Nil;
[super changePathTo: newPath];
}
- (void) changePathTo: (NSString *) newPath intoNewContainer: (id) newContainer
{
[self changePathTo: newPath];
container = newContainer;
if ([self doesRetainContainer])
[container retain];
}
// - (NSArray *) toOneRelationshipKeysMatchingQualifier: (EOQualifier *) qualifier
// andSortOrderings: (NSArray *) sortOrderings
// {

View File

@ -82,6 +82,8 @@
- (BOOL) isInPublicZone;
- (BOOL) doesRetainContainer;
/* accessors */
- (void) setContext: (WOContext *) newContext;