self.pithosContainer = aPithosContainer;
prefix = nil;
self.icon = anIcon;
- childrenUpdatedNotificationName = @"PithosContainerNodeChildrenUpdated";
}
return self;
}
[applyMetadataContainerRequest release];
[policyQuota release];
[policyVersioning release];
- [childrenUpdatedNotificationName release];
[prefix release];
[objects release];
[pithosContainer release];
}
}
+- (void)setLimitedPithosContainer:(ASIPithosContainer *)aPithosContainer {
+ if (![pithosContainer isEqualTo:aPithosContainer]) {
+ self.pithosContainer.name = aPithosContainer.name;
+ self.pithosContainer.count = aPithosContainer.count;
+ self.pithosContainer.bytes = aPithosContainer.bytes;
+ self.pithosContainer.lastModified = aPithosContainer.lastModified;
+ self.pithosContainer.untilTimestamp = aPithosContainer.untilTimestamp;
+ if (!pithosNodeInfoController) {
+ self.pithosContainer.policy = aPithosContainer.policy;
+ self.pithosContainer = pithosContainer;
+ }
+ }
+}
+
#pragma mark -
#pragma mark ASIHTTPRequestDelegate
node.parent = self;
node.shared = shared;
node.sharingAccount = sharingAccount;
+ node.inheritChildrenUpdatedNotificationName = inheritChildrenUpdatedNotificationName;
if (children) {
NSUInteger oldIndex = [children indexOfObject:node];
if (oldIndex != NSNotFound) {
// Use the same pointer value, if possible
node = [children objectAtIndex:oldIndex];
node.pithosContainer = pithosContainer;
- node.pithosObject = object;
+// node.pithosObject = object;
+ [node setLimitedPithosObject:object];
[keptNodes addIndex:oldIndex];
}
}
node.parent = self;
node.shared = shared;
node.sharingAccount = sharingAccount;
+ node.inheritChildrenUpdatedNotificationName = inheritChildrenUpdatedNotificationName;
if (children) {
NSUInteger oldIndex = [children indexOfObject:node];
if (oldIndex != NSNotFound) {
// Use the same pointer value, if possible
node = [children objectAtIndex:oldIndex];
node.pithosContainer = pithosContainer;
- node.pithosObject = object;
+// node.pithosObject = object;
+ [node setLimitedPithosObject:object];
[keptNodes addIndex:oldIndex];
}
}
node.parent = self;
node.shared = shared;
node.sharingAccount = sharingAccount;
+ node.inheritChildrenUpdatedNotificationName = inheritChildrenUpdatedNotificationName;
if (children) {
NSUInteger oldIndex = [children indexOfObject:node];
if (oldIndex != NSNotFound) {
// Use the same pointer value, if possible
node = [children objectAtIndex:oldIndex];
node.pithosContainer = pithosContainer;
- node.pithosObject = object;
+// node.pithosObject = object;
+ [node setLimitedPithosObject:object];
[keptNodes addIndex:oldIndex];
}
}
@synchronized(self) {
freshness = PithosNodeStateRefreshFinished;
}
- // Notify observers that children are updated
- [[NSNotificationCenter defaultCenter] postNotificationName:childrenUpdatedNotificationName object:self];
+ [self postChildrenUpdatedNotificationName];
} else {
[containerRequest release];
// Do an additional request to fetch more objects
@synchronized(self) {
freshness = PithosNodeStateRefreshFinished;
}
- // Notify observers that children are updated
- [[NSNotificationCenter defaultCenter] postNotificationName:childrenUpdatedNotificationName object:self];
+ [self postChildrenUpdatedNotificationName];
} else {
[self containerRequestFailed:containerRequest];
}
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSUInteger retries = [[request.userInfo objectForKey:@"retries"] unsignedIntegerValue];
if (retries > 0) {
- ASIPithosContainerRequest *newRequest = (ASIPithosContainerRequest *)[PithosUtilities copyRequest:request];
+ ASIPithosContainerRequest *newRequest = (ASIPithosContainerRequest *)[[PithosUtilities copyRequest:request] autorelease];
[(NSMutableDictionary *)(newRequest.userInfo)setObject:[NSNumber numberWithUnsignedInteger:(--retries)] forKey:@"retries"];
if ([request isEqualTo:applyMetadataContainerRequest]) {
@synchronized(self) {
#pragma mark Actions
- (void)showPithosNodeInfo:(id)sender {
- if (!pithosNodeInfoController)
+ if (!pithosNodeInfoController) {
pithosNodeInfoController = [[PithosContainerNodeInfoController alloc] initWithPithosNode:self];
+ [self refreshInfo];
+ }
[pithosNodeInfoController showWindow:sender];
[[pithosNodeInfoController window] makeKeyAndOrderFront:sender];
[NSApp activateIgnoringOtherApps:YES];