Revision d4433f6f pithos-macos/PithosNode.m

b/pithos-macos/PithosNode.m
41 41
#import "ASIPithosRequest.h"
42 42

  
43 43
@implementation PithosNode
44
@synthesize forcedRefresh, parent, shared, sharingAccount, childrenUpdatedNotificationName, displayName, isLeafItem, icon;
44
@synthesize forcedRefresh, parent, shared, sharingAccount, childrenUpdatedNotificationName, 
45
            inheritChildrenUpdatedNotificationName, displayName, isLeafItem, icon;
45 46
@dynamic url, children, pithos, pithosAccount, pithosContainer, pithosObject;
46 47

  
47 48
#pragma mark -
......
53 54
        forcedRefresh = NO;
54 55
        shared = NO;
55 56
        isLeafItem = NO;
57
        self.childrenUpdatedNotificationName = @"PithosNodeChildrenUpdated";
58
        inheritChildrenUpdatedNotificationName = NO;
56 59
    }
57 60
    return self;
58 61
}
......
124 127
    [self refresh];
125 128
}
126 129

  
130
- (void)postChildrenUpdatedNotificationName {
131
    // Notify observers that children are updated
132
    if (inheritChildrenUpdatedNotificationName) {
133
        PithosNode *ancestor = self;
134
        while (ancestor && ancestor.parent) {
135
            ancestor = ancestor.parent;
136
        }
137
        if (ancestor && ancestor.childrenUpdatedNotificationName) {
138
            [[NSNotificationCenter defaultCenter] postNotificationName:ancestor.childrenUpdatedNotificationName object:self];
139
        }
140
    } else if (childrenUpdatedNotificationName) {
141
        [[NSNotificationCenter defaultCenter] postNotificationName:childrenUpdatedNotificationName object:self];
142
    }
143
}
144

  
127 145
- (void)showPithosNodeInfo:(id)sender {
128 146
    // Abstract method
129 147
}

Also available in: Unified diff