Modify nodes to make notifications configurable and provide property access to all...
[pithos-macos] / pithos-macos / PithosContainerNode.m
index b12c98c..47d9a07 100644 (file)
@@ -67,7 +67,7 @@ static NSImage *sharedIcon = nil;
         self.pithosContainer = aPithosContainer;
         prefix = nil;
         self.icon = anIcon;
-        childrenUpdatedNotificationName = @"PithosContainerNodeChildrenUpdated";
+        self.childrenUpdatedNotificationName = [NSString stringWithString:@"PithosContainerNodeChildrenUpdated"];
     }
     return self;
 }
@@ -95,7 +95,6 @@ static NSImage *sharedIcon = nil;
     [applyMetadataContainerRequest release];
     [policyQuota release];
     [policyVersioning release];
-    [childrenUpdatedNotificationName release];
     [prefix release];
     [objects release];
     [pithosContainer release];
@@ -367,8 +366,10 @@ static NSImage *sharedIcon = nil;
             @synchronized(self) {
                 freshness = PithosNodeStateRefreshFinished;
             }
-            // Notify observers that children are updated
-            [[NSNotificationCenter defaultCenter] postNotificationName:childrenUpdatedNotificationName object:self];
+            if (childrenUpdatedNotificationName) {
+                // Notify observers that children are updated
+                [[NSNotificationCenter defaultCenter] postNotificationName:childrenUpdatedNotificationName object:self];
+            }
         } else {
             [containerRequest release];
             // Do an additional request to fetch more objects
@@ -407,8 +408,10 @@ static NSImage *sharedIcon = nil;
         @synchronized(self) {
             freshness = PithosNodeStateRefreshFinished;
         }
-        // Notify observers that children are updated
-        [[NSNotificationCenter defaultCenter] postNotificationName:childrenUpdatedNotificationName object:self];
+        if (childrenUpdatedNotificationName) {
+            // Notify observers that children are updated
+            [[NSNotificationCenter defaultCenter] postNotificationName:childrenUpdatedNotificationName object:self];
+        }
     } else {
         [self containerRequestFailed:containerRequest];
     }