// XXX sort children based on preferences
refreshing = NO;
// Notify observers that children are updated
- [[NSNotificationCenter defaultCenter] postNotificationName:@"PithosNodeChildrenUpdated" object:self];
+ [[NSNotificationCenter defaultCenter] postNotificationName:@"PithosAccountNodeChildrenUpdated" object:self];
} else {
// Do an additional request to fetch more objects
ASIPithosAccountRequest *newAccountRequest = [ASIPithosAccountRequest listContainersRequestWithLimit:0
[[sharedTreeNode mutableChildNodes] addObject:
[NSTreeNode treeNodeWithRepresentedObject:
[[[PithosEmptyNode alloc] initWithDisplayName:@"others shared"
- icon:[[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kGuestUserIcon)]
+ icon:[[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kGroupIcon)]
] autorelease]]];
self.outlineViewDataSourceArray = [NSMutableArray arrayWithObjects:containersTreeNode, sharedTreeNode, nil];
// Register for updates
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(pithosNodeChildrenUpdated:)
- name:@"PithosNodeChildrenUpdated"
+ name:@"PithosContainerNodeChildrenUpdated"
object:nil];
-
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(pithosNodeChildrenUpdated:)
+ name:@"PithosSubdirNodeChildrenUpdated"
+ object:nil];
+
[self authenticateWithAuthUser:[authenticationUserTextField stringValue] authToken:[authenticationTokenTextField stringValue]];
}
BOOL refreshing;
NSString *prefix;
+
+ NSString *childrenUpdatedNotificationName;
}
- (id)initWithPithosContainer:(ASIPithosContainer *)aPithosContainer;
#import "ASIPithosObject.h"
#import "ASIDownloadCache.h"
-static NSImage *classIcon = nil;
+static NSImage *sharedIcon = nil;
@implementation PithosContainerNode
+ (void)initialize {
if (self == [PithosContainerNode class])
- classIcon = [[NSImage imageNamed:@"container"] retain];
+ sharedIcon = [[NSImage imageNamed:@"container"] retain];
}
#pragma mark -
pithosContainer = [aPithosContainer retain];
refreshing = NO;
prefix = nil;
-
icon = [anIcon retain];
+ childrenUpdatedNotificationName = @"PithosContainerNodeChildrenUpdated";
}
return self;
}
}
- (void)dealloc {
+ [childrenUpdatedNotificationName release];
[prefix release];
[objects release];
[pithosContainer release];
// XXX sort then based on preferences
refreshing = NO;
// Notify observers that children are updated
- [[NSNotificationCenter defaultCenter] postNotificationName:@"PithosNodeChildrenUpdated" object:self];
+ [[NSNotificationCenter defaultCenter] postNotificationName:childrenUpdatedNotificationName object:self];
} else {
// Do an additional request to fetch more objects
ASIPithosContainerRequest *newContainerRequest = [ASIPithosContainerRequest listObjectsRequestWithContainerName:pithosContainer.name
- (NSImage *)icon {
if (icon)
return icon;
- return classIcon;
+ return sharedIcon;
}
@end
#import "PithosSubdirNode.h"
#import "ASIPithosRequest.h"
-static NSImage *classIcon = nil;
+static NSImage *sharedIcon = nil;
@implementation PithosSubdirNode
+ (void)initialize {
if (self == [PithosSubdirNode class])
- classIcon = [[[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kGenericFolderIcon)] retain];
+ sharedIcon = [[[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kGenericFolderIcon)] retain];
}
#pragma mark -
pithosObject = [aPithosObject retain];
refreshing = NO;
prefix = [[pithosObject.name substringToIndex:([pithosObject.name length] - 1)] retain];
+ childrenUpdatedNotificationName = @"PithosSubdirNodeChildrenUpdated";
}
return self;
}
- (NSImage *)icon {
if (icon)
return icon;
- return classIcon;
+ return sharedIcon;
}
@end