Support changes in container and object metadata.
[pithos-macos] / pithos-macos / PithosSubdirNode.m
index c8175c7..7cf150f 100644 (file)
@@ -140,6 +140,29 @@ static NSImage *sharedIcon = nil;
     }
 }
 
+- (void)setLimitedPithosObject:(ASIPithosObject *)aPithosObject {
+    if (![pithosObject isEqualTo:aPithosObject]) {
+        self.pithosObject.subdir = aPithosObject.subdir;
+        self.pithosObject.name = aPithosObject.name;
+        self.pithosObject.hash = aPithosObject.hash;
+        self.pithosObject.objectHash = aPithosObject.objectHash;
+        self.pithosObject.UUID = aPithosObject.UUID;
+        self.pithosObject.bytes = aPithosObject.bytes;
+        self.pithosObject.contentType = aPithosObject.contentType;
+        self.pithosObject.lastModified = aPithosObject.lastModified;
+        self.pithosObject.version = aPithosObject.version;
+        self.pithosObject.versionTimestamp = aPithosObject.versionTimestamp;
+        self.pithosObject.modifiedBy = aPithosObject.modifiedBy;
+        self.pithosObject.sharedBy = aPithosObject.sharedBy;
+        self.pithosObject.allowedTo = aPithosObject.allowedTo;
+        if (!pithosNodeInfoController) {
+            self.pithosObject.sharing = aPithosObject.sharing;
+            self.pithosObject.publicURI = aPithosObject.publicURI;
+            self.pithosObject = pithosObject;
+        }
+    }
+}
+
 #pragma mark -
 #pragma mark ASIHTTPRequestDelegate
 
@@ -369,8 +392,10 @@ static NSImage *sharedIcon = nil;
 #pragma mark Actions
 
 - (void)showPithosNodeInfo:(id)sender {
-    if (!pithosNodeInfoController)
+    if (!pithosNodeInfoController) {
         pithosNodeInfoController = [[PithosObjectNodeInfoController alloc] initWithPithosNode:self];
+        [self refreshInfo];
+    }
     [pithosNodeInfoController showWindow:sender];
     [[pithosNodeInfoController window] makeKeyAndOrderFront:sender];
     [NSApp activateIgnoringOtherApps:YES];