From: Miltiadis Vasilakis Date: Fri, 12 Aug 2011 10:32:53 +0000 (+0300) Subject: Minor changes. X-Git-Tag: v0.1~85 X-Git-Url: https://code.grnet.gr/git/pithos-macos/commitdiff_plain/63db4b9719f6640559d61721fa810df4a6a45867?hp=155f0dfd8217fe5bd53e4e1db00b288c2827138a Minor changes. --- diff --git a/pithos-macos/PithosAccountNode.m b/pithos-macos/PithosAccountNode.m index 6df0a35..973d7a1 100644 --- a/pithos-macos/PithosAccountNode.m +++ b/pithos-macos/PithosAccountNode.m @@ -95,7 +95,7 @@ // 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 diff --git a/pithos-macos/PithosBrowserController.m b/pithos-macos/PithosBrowserController.m index c1dd936..6720a92 100644 --- a/pithos-macos/PithosBrowserController.m +++ b/pithos-macos/PithosBrowserController.m @@ -163,7 +163,7 @@ [[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]; @@ -181,9 +181,13 @@ // 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]]; } diff --git a/pithos-macos/PithosContainerNode.h b/pithos-macos/PithosContainerNode.h index 1a3cb57..a3591b8 100644 --- a/pithos-macos/PithosContainerNode.h +++ b/pithos-macos/PithosContainerNode.h @@ -46,6 +46,8 @@ BOOL refreshing; NSString *prefix; + + NSString *childrenUpdatedNotificationName; } - (id)initWithPithosContainer:(ASIPithosContainer *)aPithosContainer; diff --git a/pithos-macos/PithosContainerNode.m b/pithos-macos/PithosContainerNode.m index 8e94ddb..989ca1a 100644 --- a/pithos-macos/PithosContainerNode.m +++ b/pithos-macos/PithosContainerNode.m @@ -42,13 +42,13 @@ #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 - @@ -59,8 +59,8 @@ static NSImage *classIcon = nil; pithosContainer = [aPithosContainer retain]; refreshing = NO; prefix = nil; - icon = [anIcon retain]; + childrenUpdatedNotificationName = @"PithosContainerNodeChildrenUpdated"; } return self; } @@ -80,6 +80,7 @@ static NSImage *classIcon = nil; } - (void)dealloc { + [childrenUpdatedNotificationName release]; [prefix release]; [objects release]; [pithosContainer release]; @@ -134,7 +135,7 @@ static NSImage *classIcon = nil; // 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 @@ -201,7 +202,7 @@ static NSImage *classIcon = nil; - (NSImage *)icon { if (icon) return icon; - return classIcon; + return sharedIcon; } @end diff --git a/pithos-macos/PithosSubdirNode.m b/pithos-macos/PithosSubdirNode.m index 058c996..94bcec1 100644 --- a/pithos-macos/PithosSubdirNode.m +++ b/pithos-macos/PithosSubdirNode.m @@ -38,13 +38,13 @@ #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 - @@ -56,6 +56,7 @@ static NSImage *classIcon = nil; pithosObject = [aPithosObject retain]; refreshing = NO; prefix = [[pithosObject.name substringToIndex:([pithosObject.name length] - 1)] retain]; + childrenUpdatedNotificationName = @"PithosSubdirNodeChildrenUpdated"; } return self; } @@ -81,7 +82,7 @@ static NSImage *classIcon = nil; - (NSImage *)icon { if (icon) return icon; - return classIcon; + return sharedIcon; } @end