Minor changes.
authorMiltiadis Vasilakis <mvasilak@gmail.com>
Fri, 12 Aug 2011 10:32:53 +0000 (13:32 +0300)
committerMiltiadis Vasilakis <mvasilak@gmail.com>
Fri, 12 Aug 2011 10:32:53 +0000 (13:32 +0300)
pithos-macos/PithosAccountNode.m
pithos-macos/PithosBrowserController.m
pithos-macos/PithosContainerNode.h
pithos-macos/PithosContainerNode.m
pithos-macos/PithosSubdirNode.m

index 6df0a35..973d7a1 100644 (file)
@@ -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 
index c1dd936..6720a92 100644 (file)
        [[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]];
 }
 
index 1a3cb57..a3591b8 100644 (file)
@@ -46,6 +46,8 @@
     BOOL refreshing;
     
     NSString *prefix;
+    
+    NSString *childrenUpdatedNotificationName;
 }
 
 - (id)initWithPithosContainer:(ASIPithosContainer *)aPithosContainer;
index 8e94ddb..989ca1a 100644 (file)
 #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
index 058c996..94bcec1 100644 (file)
 #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