NSMutableDictionary *syncContainersDictionary = [NSMutableDictionary dictionary];
for (NSString *containerName in aSyncContainersDictionary) {
if (![accountName isEqualToString:@""] || ![[containerName lowercaseString] isEqualToString:@"shared to me"])
- [syncContainersDictionary setObject:[NSMutableArray arrayWithArray:[aSyncContainersDictionary objectForKey:containerName]]
+ [syncContainersDictionary setObject:[NSMutableSet setWithSet:[aSyncContainersDictionary objectForKey:containerName]]
forKey:containerName];
}
if ([syncContainersDictionary count])
return 1;
} else if (item == syncAccountsMyAccountNode) {
// root/<my account>: #<container>
- if (selectedPithosAccount.accountNode.children)
- return selectedPithosAccount.accountNode.children.count;
+ if (selectedPithosAccount.accountNode.children) {
+ NSInteger containersCount = 0;
+ for (PithosContainerNode *node in selectedPithosAccount.accountNode.children) {
+ if (![[node.displayName lowercaseString] isEqualToString:@"shared to me"])
+ containersCount++;
+ }
+ return containersCount;
+ }
} else if ([item class] == [PithosAccountNode class]) {
// root/<sharing account>: #<container>
PithosAccountNode *accountNode = (PithosAccountNode *)item;
return [selectedPithosAccount.sharingAccountsNode.children objectAtIndex:(index - 1)];
} else if (item == syncAccountsMyAccountNode) {
// root/<my account>: [ <container>+ ]
- return [selectedPithosAccount.accountNode.children objectAtIndex:index];
+ NSInteger currentContainerIndex = -1;
+ for (PithosContainerNode *node in selectedPithosAccount.accountNode.children) {
+ if (![[node.displayName lowercaseString] isEqualToString:@"shared to me"]) {
+ currentContainerIndex++;
+ if (currentContainerIndex == index)
+ return node;
+ }
+ }
} else if ([item class] == [PithosAccountNode class]) {
// root/<sharing account>: [ <container>+ ]
return [((PithosAccountNode *)item).children objectAtIndex:index];
NSMutableDictionary *syncContainersDictionary = [syncAccountsDictionary objectForKey:@""];
if (syncContainersDictionary) {
for (PithosContainerNode *node in selectedPithosAccount.accountNode.children) {
- NSMutableArray *containerExcludedDirectories = [syncContainersDictionary objectForKey:node.displayName];
- if (!containerExcludedDirectories || [containerExcludedDirectories count])
- return [NSNumber numberWithUnsignedInteger:NSMixedState];
+ if (![[node.displayName lowercaseString] isEqualToString:@"shared to me"]) {
+ NSMutableSet *containerExcludedDirectories = [syncContainersDictionary objectForKey:node.displayName];
+ if (!containerExcludedDirectories || [containerExcludedDirectories count])
+ return [NSNumber numberWithUnsignedInteger:NSMixedState];
+ }
}
return [NSNumber numberWithUnsignedInteger:NSOnState];
}
NSMutableDictionary *syncContainersDictionary = [syncAccountsDictionary objectForKey:accountNode.displayName];
if (syncContainersDictionary) {
for (PithosContainerNode *node in accountNode.children) {
- NSMutableArray *containerExcludedDirectories = [syncContainersDictionary objectForKey:node.displayName];
+ NSMutableSet *containerExcludedDirectories = [syncContainersDictionary objectForKey:node.displayName];
if (!containerExcludedDirectories || [containerExcludedDirectories count])
return [NSNumber numberWithUnsignedInteger:NSMixedState];
}
NSString *accountName = node.sharingAccount;
if (!accountName)
accountName = @"";
- NSMutableArray *containerExcludedDirectories = [[syncAccountsDictionary objectForKey:accountName]
+ NSMutableSet *containerExcludedDirectories = [[syncAccountsDictionary objectForKey:accountName]
objectForKey:node.displayName];
if (containerExcludedDirectories) {
if ([containerExcludedDirectories count])
NSString *accountName = node.sharingAccount;
if (!accountName)
accountName = @"";
- NSMutableArray *containerExcludedDirectories = [[syncAccountsDictionary objectForKey:accountName]
+ NSMutableSet *containerExcludedDirectories = [[syncAccountsDictionary objectForKey:accountName]
objectForKey:node.parent.displayName];
if (!containerExcludedDirectories ||
[containerExcludedDirectories
NSString *accountName = node.parent.sharingAccount;
if (!accountName)
accountName = @"";
- NSMutableArray *containerExcludedDirectories = [[syncAccountsDictionary objectForKey:accountName]
+ NSMutableSet *containerExcludedDirectories = [[syncAccountsDictionary objectForKey:accountName]
objectForKey:node.parent.displayName];
if (!containerExcludedDirectories || [containerExcludedDirectories containsObject:@""])
return [NSNumber numberWithUnsignedInteger:NSOffState];
if ((newState == NSOnState) || (newState == NSMixedState)) {
NSMutableDictionary *syncContainersDictionary = [NSMutableDictionary dictionary];
for (PithosContainerNode *node in selectedPithosAccount.accountNode.children) {
- [syncContainersDictionary setObject:[NSMutableArray array] forKey:node.displayName];
+ if (![[node.displayName lowercaseString] isEqualToString:@"shared to me"])
+ [syncContainersDictionary setObject:[NSMutableSet set] forKey:node.displayName];
}
[syncAccountsDictionary setObject:syncContainersDictionary forKey:@""];
} else {
if ((newState == NSOnState) || (newState == NSMixedState)) {
NSMutableDictionary *syncContainersDictionary = [NSMutableDictionary dictionary];
for (PithosContainerNode *node in accountNode.children) {
- [syncContainersDictionary setObject:[NSMutableArray array] forKey:node.displayName];
+ [syncContainersDictionary setObject:[NSMutableSet set] forKey:node.displayName];
}
[syncAccountsDictionary setObject:syncContainersDictionary forKey:accountNode.displayName];
} else {
accountName = @"";
accountNode = syncAccountsMyAccountNode;
}
- if ([accountName isEqualToString:@""] && [[node.displayName lowercaseString] isEqualToString:@"shared to me"]) {
- [outlineView reloadItem:item];
- return;
- }
NSMutableDictionary *syncContainersDictionary = [syncAccountsDictionary objectForKey:accountName];
if ((newState == NSOnState) || (newState == NSMixedState)) {
if (!syncContainersDictionary) {
syncContainersDictionary = [NSMutableDictionary dictionary];
[syncAccountsDictionary setObject:syncContainersDictionary forKey:accountName];
}
- [syncContainersDictionary setObject:[NSMutableArray array] forKey:node.displayName];
+ [syncContainersDictionary setObject:[NSMutableSet set] forKey:node.displayName];
} else if (syncContainersDictionary) {
[syncContainersDictionary removeObjectForKey:node.displayName];
if (![syncContainersDictionary count])
accountNode = syncAccountsMyAccountNode;
}
NSMutableDictionary *syncContainersDictionary = [syncAccountsDictionary objectForKey:accountName];
- NSMutableArray *containerExcludedDirectories = [syncContainersDictionary objectForKey:node.parent.displayName];
+ NSMutableSet *containerExcludedDirectories = [syncContainersDictionary objectForKey:node.parent.displayName];
NSString *directoryName = [[node.displayName lowercaseString] stringByReplacingOccurrencesOfString:@"/" withString:@":"];
if ((newState == NSOnState) || (newState == NSMixedState)) {
if (containerExcludedDirectories) {
syncContainersDictionary = [NSMutableDictionary dictionary];
[syncAccountsDictionary setObject:syncContainersDictionary forKey:accountName];
}
- NSMutableArray *newContainerExcludeDirectories = [NSMutableArray arrayWithObject:@""];
+ NSMutableSet *newContainerExcludeDirectories = [NSMutableSet setWithObject:@""];
for (PithosNode *siblingNode in node.parent.children) {
if ([siblingNode class] == [PithosSubdirNode class]) {
NSString *siblingDirectoryName = [[siblingNode.displayName lowercaseString]
accountNode = syncAccountsMyAccountNode;
}
NSMutableDictionary *syncContainersDictionary = [syncAccountsDictionary objectForKey:accountName];
- NSMutableArray *containerExcludedDirectories = [syncContainersDictionary objectForKey:node.parent.displayName];
+ NSMutableSet *containerExcludedDirectories = [syncContainersDictionary objectForKey:node.parent.displayName];
if ((newState == NSOnState) || (newState == NSMixedState)) {
if (containerExcludedDirectories) {
[containerExcludedDirectories removeObject:@""];
syncContainersDictionary = [NSMutableDictionary dictionary];
[syncAccountsDictionary setObject:syncContainersDictionary forKey:accountName];
}
- NSMutableArray *newContainerExcludeDirectories = [NSMutableArray array];
+ NSMutableSet *newContainerExcludeDirectories = [NSMutableSet set];
for (PithosNode *siblingNode in node.parent.children) {
if ([siblingNode class] == [PithosSubdirNode class]) {
NSString *siblingDirectoryName = [[siblingNode.displayName lowercaseString]
for (NSString *accountName in accountsNames) {
for (ASIPithosContainer *pithosContainer in [accountsPithosContainers objectForKey:accountName]) {
NSString *containerDirectoryPath = [self dirPathForAccount:accountName container:pithosContainer.name];
- NSArray *containerExcludedDirectories = [[accountsDictionary objectForKey:accountName] objectForKey:pithosContainer.name];
+ NSSet *containerExcludedDirectories = [[accountsDictionary objectForKey:accountName] objectForKey:pithosContainer.name];
BOOL containerExludeRootFiles = [containerExcludedDirectories containsObject:@""];
NSMutableDictionary *containerStoredLocalObjectStates = [[storedLocalObjectStates objectForKey:accountName]
objectForKey:pithosContainer.name];
// Add an empty stored state for legal new remote objects since last sync
for (NSString *accountName in accountsNames) {
for (ASIPithosContainer *pithosContainer in [accountsPithosContainers objectForKey:accountName]) {
- NSArray *containerExcludedDirectories = [[accountsDictionary objectForKey:accountName] objectForKey:pithosContainer.name];
+ NSSet *containerExcludedDirectories = [[accountsDictionary objectForKey:accountName] objectForKey:pithosContainer.name];
BOOL containerExludeRootFiles = [containerExcludedDirectories containsObject:@""];
NSMutableDictionary *containerStoredLocalObjectStates = [[storedLocalObjectStates objectForKey:accountName]
objectForKey:pithosContainer.name];
for (NSString *accountName in accountsNames) {
for (ASIPithosContainer *pithosContainer in [accountsPithosContainers objectForKey:accountName]) {
NSString *containerDirectoryPath = [self dirPathForAccount:accountName container:pithosContainer.name];
- NSArray *containerExcludedDirectories = [[accountsDictionary objectForKey:accountName] objectForKey:pithosContainer.name];
+ NSSet *containerExcludedDirectories = [[accountsDictionary objectForKey:accountName] objectForKey:pithosContainer.name];
BOOL containerExludeRootFiles = [containerExcludedDirectories containsObject:@""];
NSMutableDictionary *containerStoredLocalObjectStates = [[storedLocalObjectStates objectForKey:accountName]
objectForKey:pithosContainer.name];