Improve UUID translation in nodes
authorMiltiadis Vasilakis <mvasilak@gmail.com>
Fri, 15 Mar 2013 16:21:31 +0000 (18:21 +0200)
committerMiltiadis Vasilakis <mvasilak@gmail.com>
Fri, 15 Mar 2013 16:21:31 +0000 (18:21 +0200)
Show nodes immediately with translated UUIDs. Fix bug where browser of first created account didn't translate UUIDs.

16 files changed:
pithos-macos/PithosAccount.m
pithos-macos/PithosAccountNode.h
pithos-macos/PithosAccountNode.m
pithos-macos/PithosBrowserController.m
pithos-macos/PithosBrowserPreviewController.xib
pithos-macos/PithosContainerNode.h
pithos-macos/PithosContainerNode.m
pithos-macos/PithosNode.h
pithos-macos/PithosNode.m
pithos-macos/PithosObjectNode.h
pithos-macos/PithosObjectNode.m
pithos-macos/PithosSharingAccountsNode.h
pithos-macos/PithosSharingAccountsNode.m
pithos-macos/PithosSubdirNode.h
pithos-macos/PithosSubdirNode.m
pithos-macos/pithos_macosAppDelegate.m

index e054383..0250f15 100644 (file)
 
 - (PithosAccountNode *)accountNode {
     if (!accountNode) {
-        accountNode = [[PithosAccountNode alloc] initWithPithos:self.pithos];
+        accountNode = [[PithosAccountNode alloc] initWithPithosAccountManager:self andPithos:self.pithos];
         accountNode.childrenUpdatedNotificationName = nil;
         accountNode.inheritChildrenUpdatedNotificationName = YES;
-        accountNode.pithosAccountManager = self;
     }
     return accountNode;
 }
 
 - (PithosSharingAccountsNode *)sharingAccountsNode {
     if (!sharingAccountsNode) {
-        sharingAccountsNode = [[PithosSharingAccountsNode alloc] initWithPithos:self.pithos];
+        sharingAccountsNode = [[PithosSharingAccountsNode alloc] initWithPithosAccountManager:self andPithos:self.pithos];
         sharingAccountsNode.childrenUpdatedNotificationName = nil;
         sharingAccountsNode.inheritChildrenUpdatedNotificationName = YES;
-        sharingAccountsNode.pithosAccountManager = self;
     }
     return sharingAccountsNode;
 }
         self.syncActive = NO;
         // XXX Show preferences with self as the selected account?
     } else  {
+        [self updateUserCatalogForForDisplaynames:nil UUIDs:[NSArray arrayWithObject:authUser]];
+        
         self.active = YES;
         if (syncDaemon) {
             self.syncDaemon.pithos = self.pithos;
         }
         if (sharingAccountsNode && self.sharingAccountsNode.children) {
         }
-        
-        [self updateUserCatalogForForDisplaynames:nil UUIDs:[NSArray arrayWithObject:authUser]];
     }
 }
 
index b96f2e7..5fdd816 100644 (file)
@@ -61,7 +61,7 @@
 @property(nonatomic, strong) ASIPithosAccountRequest *refreshMetadataAccountRequest;
 @property(nonatomic, strong) NSMutableDictionary *translatedGroups;
 
-- (id)initWithPithos:(ASIPithos *)aPithos;
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager andPithos:(ASIPithos *)aPithos;
 
 - (void)applyInfo;
 - (void)refreshInfo;
index 329b610..4279efc 100644 (file)
@@ -59,8 +59,8 @@ static NSImage *sharedIcon = nil;
 #pragma mark -
 #pragma mark Object Lifecycle
 
-- (id)initWithPithos:(ASIPithos *)aPithos {
-    if ((self = [super init])) {
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager andPithos:(ASIPithos *)aPithos {
+    if ((self = [super initWithPithosAccountManager:aPithosAccountManager])) {
         pithos = aPithos;
     }
     return self;
@@ -264,12 +264,13 @@ static NSImage *sharedIcon = nil;
                     newChildren = [[NSMutableArray alloc] init];
                     NSMutableIndexSet *keptNodes = [NSMutableIndexSet indexSet];
                     for (ASIPithosContainer *container in containers) {
-                        PithosContainerNode *node = [[PithosContainerNode alloc] initWithPithos:pithos pithosContainer:container];
+                        PithosContainerNode *node = [[PithosContainerNode alloc] initWithPithosAccountManager:pithosAccountManager
+                                                                                                    andPithos:pithos
+                                                                                              pithosContainer:container];
                         node.parent = self;
                         node.shared = shared;
                         node.sharingAccount = sharingAccount;
                         node.inheritChildrenUpdatedNotificationName = inheritChildrenUpdatedNotificationName;
-                        node.pithosAccountManager = pithosAccountManager;
                         if (children) {
                             NSUInteger oldIndex = [children indexOfObject:node];
                             if (oldIndex != NSNotFound) {
index 357aa9f..3f8cbb0 100644 (file)
     [activityProgressIndicator setMaxValue:1.0];
     activityFacility = [PithosActivityFacility defaultPithosActivityFacility];
     
-    self.accountNode = [[PithosAccountNode alloc] initWithPithos:pithos];
-    accountNode.pithosAccountManager = pithosAccountManager;
+    self.accountNode = [[PithosAccountNode alloc] initWithPithosAccountManager:pithosAccountManager andPithos:pithos];
     containersNode = [[PithosEmptyNode alloc] initWithDisplayName:@"CONTAINERS" icon:nil];
     containersNodeChildren = [[NSMutableArray alloc] init];
     sharedNode = [[PithosEmptyNode alloc] initWithDisplayName:@"SHARED" icon:nil];
-    mySharedNode = [[PithosAccountNode alloc] initWithPithos:pithos];
-    mySharedNode.pithosAccountManager = pithosAccountManager;
+    mySharedNode = [[PithosAccountNode alloc] initWithPithosAccountManager:pithosAccountManager andPithos:pithos];
     mySharedNode.displayName = @"shared by me";
     mySharedNode.shared = YES;
     mySharedNode.icon = [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kUserIcon)];
-    othersSharedNode = [[PithosSharingAccountsNode alloc] initWithPithos:pithos];
-    othersSharedNode.pithosAccountManager = pithosAccountManager;
+    othersSharedNode = [[PithosSharingAccountsNode alloc] initWithPithosAccountManager:pithosAccountManager andPithos:pithos];
     othersSharedNode.displayName = @"shared with me";
     othersSharedNode.icon = [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kGroupIcon)];
     
index f04f81e..4c329f7 100644 (file)
@@ -51,6 +51,7 @@
                                                <int key="NSvFlags">269</int>
                                                <string key="NSFrame">{{49, 18}, {102, 19}}</string>
                                                <reference key="NSSuperview" ref="1005"/>
+                                               <reference key="NSWindow"/>
                                                <reference key="NSNextKeyView"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSButtonCell" key="NSCell" id="1036336951">
@@ -76,6 +77,7 @@
                                                <int key="NSvFlags">271</int>
                                                <string key="NSFrame">{{1, 45}, {98, 14}}</string>
                                                <reference key="NSSuperview" ref="1005"/>
+                                               <reference key="NSWindow"/>
                                                <reference key="NSNextKeyView" ref="711438167"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSTextFieldCell" key="NSCell" id="984886579">
                                                <int key="NSvFlags">271</int>
                                                <string key="NSFrame">{{1, 61}, {98, 14}}</string>
                                                <reference key="NSSuperview" ref="1005"/>
+                                               <reference key="NSWindow"/>
                                                <reference key="NSNextKeyView" ref="348582496"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSTextFieldCell" key="NSCell" id="358475028">
                                                <int key="NSvFlags">271</int>
                                                <string key="NSFrame">{{1, 77}, {98, 14}}</string>
                                                <reference key="NSSuperview" ref="1005"/>
+                                               <reference key="NSWindow"/>
                                                <reference key="NSNextKeyView" ref="490957876"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSTextFieldCell" key="NSCell" id="423776930">
                                                <int key="NSvFlags">271</int>
                                                <string key="NSFrame">{{1, 93}, {98, 14}}</string>
                                                <reference key="NSSuperview" ref="1005"/>
+                                               <reference key="NSWindow"/>
                                                <reference key="NSNextKeyView" ref="458298377"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSTextFieldCell" key="NSCell" id="27846884">
                                                <int key="NSvFlags">271</int>
                                                <string key="NSFrame">{{1, 109}, {98, 14}}</string>
                                                <reference key="NSSuperview" ref="1005"/>
+                                               <reference key="NSWindow"/>
                                                <reference key="NSNextKeyView" ref="933584688"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSTextFieldCell" key="NSCell" id="726762919">
                                                <int key="NSvFlags">271</int>
                                                <string key="NSFrame">{{1, 125}, {98, 14}}</string>
                                                <reference key="NSSuperview" ref="1005"/>
+                                               <reference key="NSWindow"/>
                                                <reference key="NSNextKeyView" ref="183377333"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSTextFieldCell" key="NSCell" id="558074580">
                                                <int key="NSvFlags">271</int>
                                                <string key="NSFrame">{{101, 45}, {98, 14}}</string>
                                                <reference key="NSSuperview" ref="1005"/>
+                                               <reference key="NSWindow"/>
                                                <reference key="NSNextKeyView" ref="241278852"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSTextFieldCell" key="NSCell" id="948332378">
                                                <int key="NSvFlags">271</int>
                                                <string key="NSFrame">{{101, 61}, {98, 14}}</string>
                                                <reference key="NSSuperview" ref="1005"/>
+                                               <reference key="NSWindow"/>
                                                <reference key="NSNextKeyView" ref="361683768"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSTextFieldCell" key="NSCell" id="373378417">
                                                        <int key="NSCellFlags">67239488</int>
                                                        <int key="NSCellFlags2">4196352</int>
-                                                       <string key="NSContents">Modified</string>
+                                                       <string key="NSContents">Modified by</string>
                                                        <reference key="NSSupport" ref="611945789"/>
                                                        <reference key="NSControlView" ref="348582496"/>
                                                        <reference key="NSBackgroundColor" ref="363018318"/>
                                                <int key="NSvFlags">271</int>
                                                <string key="NSFrame">{{101, 77}, {98, 14}}</string>
                                                <reference key="NSSuperview" ref="1005"/>
+                                               <reference key="NSWindow"/>
                                                <reference key="NSNextKeyView" ref="779495175"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSTextFieldCell" key="NSCell" id="622580923">
                                                <int key="NSvFlags">271</int>
                                                <string key="NSFrame">{{101, 93}, {98, 14}}</string>
                                                <reference key="NSSuperview" ref="1005"/>
+                                               <reference key="NSWindow"/>
                                                <reference key="NSNextKeyView" ref="130674256"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSTextFieldCell" key="NSCell" id="599752880">
                                                <int key="NSvFlags">271</int>
                                                <string key="NSFrame">{{101, 109}, {98, 14}}</string>
                                                <reference key="NSSuperview" ref="1005"/>
+                                               <reference key="NSWindow"/>
                                                <reference key="NSNextKeyView" ref="363250715"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSTextFieldCell" key="NSCell" id="11695648">
                                                <int key="NSvFlags">271</int>
                                                <string key="NSFrame">{{101, 125}, {98, 14}}</string>
                                                <reference key="NSSuperview" ref="1005"/>
+                                               <reference key="NSWindow"/>
                                                <reference key="NSNextKeyView" ref="261591603"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSTextFieldCell" key="NSCell" id="59179920">
                                                </object>
                                                <string key="NSFrame">{{36, 147}, {128, 128}}</string>
                                                <reference key="NSSuperview" ref="1005"/>
+                                               <reference key="NSWindow"/>
                                                <reference key="NSNextKeyView" ref="774296355"/>
                                                <bool key="NSEnabled">YES</bool>
                                                <object class="NSImageCell" key="NSCell" id="327417217">
                                </object>
                                <string key="NSFrameSize">{200, 295}</string>
                                <reference key="NSSuperview"/>
+                               <reference key="NSWindow"/>
                                <reference key="NSNextKeyView" ref="501039666"/>
                                <string key="NSClassName">NSView</string>
                        </object>
                                                        <string key="NSLabel">value: representedObject.translatedModifiedBy</string>
                                                        <string key="NSBinding">value</string>
                                                        <string key="NSKeyPath">representedObject.translatedModifiedBy</string>
+                                                       <object class="NSDictionary" key="NSOptions">
+                                                               <string key="NS.key.0">NSNullPlaceholder</string>
+                                                               <string key="NS.object.0">-</string>
+                                                       </object>
                                                        <int key="NSNibBindingConnectorVersion">2</int>
                                                </object>
                                        </object>
-                                       <int key="connectionID">98</int>
+                                       <int key="connectionID">101</int>
                                </object>
                                <object class="IBConnectionRecord">
                                        <object class="IBBindingConnection" key="connection">
                                <reference key="dict.values" ref="0"/>
                        </object>
                        <nil key="sourceID"/>
-                       <int key="maxID">98</int>
+                       <int key="maxID">101</int>
                </object>
                <object class="IBClassDescriber" key="IBDocument.Classes"/>
                <int key="IBDocument.localizationMode">0</int>
index 7fdc335..9028528 100644 (file)
     NSNumber *policyQuota;
 }
 
-- (id)initWithPithos:(ASIPithos *)aPithos pithosContainer:(ASIPithosContainer *)aPithosContainer;
-- (id)initWithPithos:(ASIPithos *)aPithos pithosContainer:(ASIPithosContainer *)aPithosContainer icon:(NSImage *)anIcon;
-- (id)initWithPithos:(ASIPithos *)aPithos containerName:(NSString *)aContainerName;
-- (id)initWithPithos:(ASIPithos *)aPithos containerName:(NSString *)aContainerName icon:(NSImage *)anIcon;
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager
+                         andPithos:(ASIPithos *)aPithos pithosContainer:(ASIPithosContainer *)aPithosContainer;
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager
+                         andPithos:(ASIPithos *)aPithos pithosContainer:(ASIPithosContainer *)aPithosContainer icon:(NSImage *)anIcon;
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager
+                         andPithos:(ASIPithos *)aPithos containerName:(NSString *)aContainerName;
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager
+                         andPithos:(ASIPithos *)aPithos containerName:(NSString *)aContainerName icon:(NSImage *)anIcon;
 
 @property(nonatomic, strong) ASIPithos *pithos;
 @property(nonatomic, strong) ASIPithosContainer *pithosContainer;
index e3d6200..a96a7cd 100644 (file)
@@ -61,28 +61,31 @@ static NSImage *sharedIcon = nil;
 #pragma mark -
 #pragma mark Object Lifecycle
 
-- (id)initWithPithos:(ASIPithos *)aPithos pithosContainer:(ASIPithosContainer *)aPithosContainer icon:(NSImage *)anIcon {
-    if ((self = [super init])) {
-        self.pithos = aPithos;
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager
+                         andPithos:(ASIPithos *)aPithos pithosContainer:(ASIPithosContainer *)aPithosContainer icon:(NSImage *)anIcon {
+    if ((self = [super initWithPithosAccountManager:aPithosAccountManager])) {
+        pithos = aPithos;
         self.pithosContainer = aPithosContainer;
-        prefix = nil;
         self.icon = anIcon;
     }
     return self;
 }
 
-- (id)initWithPithos:(ASIPithos *)aPithos pithosContainer:(ASIPithosContainer *)aPithosContainer {
-    return [self initWithPithos:aPithos pithosContainer:aPithosContainer icon:nil];
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager
+                         andPithos:(ASIPithos *)aPithos pithosContainer:(ASIPithosContainer *)aPithosContainer {
+    return [self initWithPithosAccountManager:aPithosAccountManager andPithos:aPithos pithosContainer:aPithosContainer icon:nil];
 }
 
-- (id)initWithPithos:(ASIPithos *)aPithos containerName:(NSString *)aContainerName icon:(NSImage *)anIcon {
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager
+                         andPithos:(ASIPithos *)aPithos containerName:(NSString *)aContainerName icon:(NSImage *)anIcon {
     ASIPithosContainer *container = [ASIPithosContainer container];
     container.name = aContainerName;
-    return [self initWithPithos:aPithos pithosContainer:container icon:anIcon];
+    return [self initWithPithosAccountManager:aPithosAccountManager andPithos:aPithos pithosContainer:container icon:anIcon];
 }
 
-- (id)initWithPithos:(ASIPithos *)aPithos containerName:(NSString *)aContainerName {
-    return [self initWithPithos:aPithos containerName:aContainerName icon:nil];
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager
+                         andPithos:(ASIPithos *)aPithos containerName:(NSString *)aContainerName {
+    return [self initWithPithosAccountManager:aPithosAccountManager andPithos:aPithos containerName:aContainerName icon:nil];
 }
 
 - (void)dealloc {
@@ -269,14 +272,14 @@ static NSImage *sharedIcon = nil;
                                 NSUInteger sameNameObjectIndex = [objectNames indexOfObject:[object.name substringToIndex:([object.name length] - 1)]];
                                 if ((sameNameObjectIndex == NSNotFound) || 
                                     ![PithosUtilities isContentTypeDirectory:[[objects objectAtIndex:sameNameObjectIndex] contentType]]) {
-                                    PithosSubdirNode *node = [[PithosSubdirNode alloc] initWithPithos:pithos 
-                                                                                       pithosContainer:pithosContainer 
-                                                                                          pithosObject:object];
+                                    PithosSubdirNode *node = [[PithosSubdirNode alloc] initWithPithosAccountManager:pithosAccountManager
+                                                                                                          andPithos:pithos
+                                                                                                    pithosContainer:pithosContainer
+                                                                                                       pithosObject:object];
                                     node.parent = self;
                                     node.shared = shared;
                                     node.sharingAccount = sharingAccount;
                                     node.inheritChildrenUpdatedNotificationName = inheritChildrenUpdatedNotificationName;
-                                    node.pithosAccountManager = pithosAccountManager;
                                     if (children) {
                                         NSUInteger oldIndex = [children indexOfObject:node];
                                         if (oldIndex != NSNotFound) {
@@ -293,14 +296,14 @@ static NSImage *sharedIcon = nil;
                                     [newChildren addObject:node];
                                 }
                             } else if ([PithosUtilities isContentTypeDirectory:object.contentType]) {
-                                PithosSubdirNode *node = [[PithosSubdirNode alloc] initWithPithos:pithos 
-                                                                                   pithosContainer:pithosContainer 
-                                                                                      pithosObject:object];
+                                PithosSubdirNode *node = [[PithosSubdirNode alloc] initWithPithosAccountManager:pithosAccountManager
+                                                                                                      andPithos:pithos
+                                                                                                pithosContainer:pithosContainer
+                                                                                                   pithosObject:object];
                                 node.parent = self;
                                 node.shared = shared;
                                 node.sharingAccount = sharingAccount;
                                 node.inheritChildrenUpdatedNotificationName = inheritChildrenUpdatedNotificationName;
-                                node.pithosAccountManager = pithosAccountManager;
                                 if (children) {
                                     NSUInteger oldIndex = [children indexOfObject:node];
                                     if (oldIndex != NSNotFound) {
@@ -314,14 +317,14 @@ static NSImage *sharedIcon = nil;
                                 }
                                 [newChildren addObject:node];
                             } else {
-                                PithosObjectNode *node = [[PithosObjectNode alloc] initWithPithos:pithos 
-                                                                                   pithosContainer:pithosContainer 
-                                                                                      pithosObject:object];
+                                PithosObjectNode *node = [[PithosObjectNode alloc] initWithPithosAccountManager:pithosAccountManager
+                                                                                                      andPithos:pithos
+                                                                                                pithosContainer:pithosContainer
+                                                                                                   pithosObject:object];
                                 node.parent = self;
                                 node.shared = shared;
                                 node.sharingAccount = sharingAccount;
                                 node.inheritChildrenUpdatedNotificationName = inheritChildrenUpdatedNotificationName;
-                                node.pithosAccountManager = pithosAccountManager;
                                 if (children) {
                                     NSUInteger oldIndex = [children indexOfObject:node];
                                     if (oldIndex != NSNotFound) {
index 5461360..0708bb9 100644 (file)
@@ -93,6 +93,8 @@
 @property(nonatomic, strong) ASIPithosContainer *pithosContainer;
 @property(nonatomic, strong) ASIPithosObject *pithosObject;
 
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager;
+
 - (void)invalidateChildren;
 - (void)invalidateChildrenRecursive;
 - (void)refresh;
index b7dbd99..c77db38 100644 (file)
@@ -47,9 +47,9 @@
 #pragma mark -
 #pragma mark Object Lifecycle
 
-- (id)init {
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager {
     if ((self = [super init])) {
-        pithosAccountManager = nil;
+        self.pithosAccountManager = aPithosAccountManager;
         freshness = PithosNodeStateRefreshNeeded;
         forcedRefresh = NO;
         shared = NO;
@@ -60,6 +60,9 @@
     return self;
 }
 
+- (id)init {
+    return [self initWithPithosAccountManager:nil];
+}
 
 - (BOOL)isEqual:(id)anObject {
     return ([anObject isKindOfClass:[self class]] && [((PithosNode *)anObject).url isEqual:self.url]);
index f0b1318..a7b0230 100644 (file)
     NSMutableArray *translatedPermissions;
 }
 
-- (id)initWithPithos:(ASIPithos *)aPithos 
-     pithosContainer:(ASIPithosContainer *)aPithosContainer 
-        pithosObject:(ASIPithosObject *)aPithosObject;
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager
+                         andPithos:(ASIPithos *)aPithos
+                   pithosContainer:(ASIPithosContainer *)aPithosContainer
+                      pithosObject:(ASIPithosObject *)aPithosObject;
 
 @property (nonatomic, strong) ASIPithos *pithos;
 @property (nonatomic, strong) ASIPithosContainer *pithosContainer;
index 1cf8cf1..7587e6e 100644 (file)
 #pragma mark -
 #pragma mark Object Lifecycle
 
-- (id)initWithPithos:(ASIPithos *)aPithos 
-     pithosContainer:(ASIPithosContainer *)aPithosContainer 
-        pithosObject:(ASIPithosObject *)aPithosObject {
-    if ((self = [super init])) {
-        self.pithos = aPithos;
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager
+                         andPithos:(ASIPithos *)aPithos
+                   pithosContainer:(ASIPithosContainer *)aPithosContainer
+                      pithosObject:(ASIPithosObject *)aPithosObject {
+    if ((self = [super initWithPithosAccountManager:aPithosAccountManager])) {
+        pithos = aPithos;
+        isLeafItem = YES;
         self.pithosContainer = aPithosContainer;
         self.pithosObject = aPithosObject;
-        isLeafItem = YES;
     }
     return self;
 }
index 5f86aea..bf3aa97 100644 (file)
@@ -50,6 +50,6 @@
 @property(nonatomic, strong) ASIPithos *pithos;
 @property(nonatomic, strong) ASIPithosRequest *sharingAccountsRequest;
 
-- (id)initWithPithos:(ASIPithos *)aPithos;
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager andPithos:(ASIPithos *)aPithos;
 
 @end
\ No newline at end of file
index c30091c..76352d0 100644 (file)
@@ -51,8 +51,8 @@
 #pragma mark -
 #pragma mark Object Lifecycle
 
-- (id)initWithPithos:(ASIPithos *)aPithos {
-    if ((self = [super init])) {
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager andPithos:(ASIPithos *)aPithos {
+    if ((self = [super initWithPithosAccountManager:aPithosAccountManager])) {
         pithos = aPithos;
         self.sharingAccount = @"";
     }
                     NSMutableIndexSet *keptNodes = [NSMutableIndexSet indexSet];
                     for (ASIPithosAccount *account in sharingAccounts) {
                         if (![account.name isEqualToString:pithos.authUser]) {
-                            PithosAccountNode *node = [[PithosAccountNode alloc] initWithPithos:pithos];
+                            PithosAccountNode *node = [[PithosAccountNode alloc] initWithPithosAccountManager:pithosAccountManager
+                                                                                                    andPithos:pithos];
                             node.parent = self;
                             node.shared = shared;
                             node.sharingAccount = account.name;
                             node.inheritChildrenUpdatedNotificationName = inheritChildrenUpdatedNotificationName;
-                            node.pithosAccountManager = pithosAccountManager;
                             if (children) {
                                 NSUInteger oldIndex = [children indexOfObject:node];
                                 if (oldIndex != NSNotFound) {
index 2d55b0e..6bb0e37 100644 (file)
     BOOL refreshParent;
 }
 
-- (id)initWithPithos:(ASIPithos *)aPithos 
-     pithosContainer:(ASIPithosContainer *)aPithosContainer 
-        pithosObject:(ASIPithosObject *)aPithosObject;
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager
+                         andPithos:(ASIPithos *)aPithos
+                   pithosContainer:(ASIPithosContainer *)aPithosContainer
+                      pithosObject:(ASIPithosObject *)aPithosObject;
 
 @property (nonatomic, strong) ASIPithosObject *pithosObject;
 @property (nonatomic, strong) NSArray *versions;
index d5744a1..7c3d513 100644 (file)
@@ -62,14 +62,15 @@ static NSImage *sharedIcon = nil;
 #pragma mark -
 #pragma mark Object Lifecycle
 
-- (id)initWithPithos:(ASIPithos *)aPithos 
-     pithosContainer:(ASIPithosContainer *)aPithosContainer 
-        pithosObject:(ASIPithosObject *)aPithosObject {
-    if ((self = [super init])) {
-        self.pithos = aPithos;
+- (id)initWithPithosAccountManager:(PithosAccount *)aPithosAccountManager
+                         andPithos:(ASIPithos *)aPithos
+                   pithosContainer:(ASIPithosContainer *)aPithosContainer
+                      pithosObject:(ASIPithosObject *)aPithosObject {
+    if ((self = [super initWithPithosAccountManager:aPithosAccountManager])) {
+        pithos = aPithos;
+        refreshParent = NO;
         self.pithosContainer = aPithosContainer;
         self.pithosObject = aPithosObject;
-        refreshParent = NO;
     }
     return self;
 }
index 01d4c87..95d22ae 100644 (file)
@@ -97,14 +97,14 @@ currentPithosAccount, pithosAccounts, pithosAccountsDictionary, syncPithosAccoun
     for (PithosAccount *pithosAccount in pithosAccounts) {
         [pithosAccountsDictionary setObject:pithosAccount forKey:pithosAccount.name];
         if (!currentPithosAccount && pithosAccount.active)
-            currentPithosAccount = pithosAccount;
+            self.currentPithosAccount = pithosAccount;
     }
     if (!currentPithosAccount)
         self.currentPithosAccount = [pithosAccounts objectAtIndex:0];
+    self.pithosBrowserController.pithosAccountManager = currentPithosAccount;
     
     if (currentPithosAccount.active) {
         [self savePithosAccounts:self];
-        self.pithosBrowserController.pithosAccountManager = currentPithosAccount;
         [self showPithosBrowser:self];
         self.pithosBrowserController.pithos = currentPithosAccount.pithos;
     } else {
@@ -459,6 +459,7 @@ void LSSharedFileListChanged(LSSharedFileListRef inList, void *context) {
             [self.pithosBrowserController.window close];
             [self.pithosBrowserController resetBrowser];
             self.currentPithosAccount = [pithosAccounts objectAtIndex:0];
+            self.pithosBrowserController.pithosAccountManager = currentPithosAccount;
         }
     }
     if ([self.syncPithosAccount isEqualTo:removedPithosAccount])