Simplify default and support custom notifications for nodes.
[pithos-macos] / pithos-macos / PithosSharingAccountsNode.m
index a908f5c..f96b598 100644 (file)
@@ -54,7 +54,6 @@
     if ((self = [super init])) {
         self.pithos = aPithos;
         self.sharingAccount = @"";
-        self.childrenUpdatedNotificationName = [NSString stringWithString:@"PithosSharingAccountsNodeChildrenUpdated"];
     }
     return self;
 }
                         node.parent = self;
                         node.shared = shared;
                         node.sharingAccount = account.name;
+                        node.inheritChildrenUpdatedNotificationName = inheritChildrenUpdatedNotificationName;
                         if (children) {
                             NSUInteger oldIndex = [children indexOfObject:node];
                             if (oldIndex != NSNotFound) {
             @synchronized(self) {
                 freshness = PithosNodeStateRefreshFinished;
             }
-            if (childrenUpdatedNotificationName) {
-                // Notify observers that children are updated
-                [[NSNotificationCenter defaultCenter] postNotificationName:childrenUpdatedNotificationName object:self];
-            }
+            [self postChildrenUpdatedNotificationName];
         } else {
             [sharingAccountsRequest release];
             // Do an additional request to fetch more objects