Monotone-Parent: e0d6a2d51589348dbe6602973f8a6ae6718f0991

Monotone-Revision: e57c559e7f4acc6c125cef6398101fdf444f5d7b

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-07-16T13:52:53
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2009-07-16 13:52:53 +00:00
parent 18afa2eecd
commit a88f5d7ad6
16 changed files with 85 additions and 302 deletions
+9 -45
View File
@@ -791,54 +791,18 @@ iRANGE(2);
- (NSArray *) categoryList
{
static NSArray *categoryItems = nil;
NSMutableArray *categoryList;
unsigned int count, max;
NSString *categoryItem, *newCategoryItem;
NSArray *categoryLabels;
if (!categoryItems)
{
categoryItems = [NSArray arrayWithObjects: @"ANNIVERSARY",
@"BIRTHDAY",
@"BUSINESS",
@"CALLS",
@"CLIENTS",
@"COMPETITION",
@"CUSTOMER",
@"FAVORITES",
@"FOLLOW UP",
@"GIFTS",
@"HOLIDAYS",
@"IDEAS",
@"ISSUES",
@"MISCELLANEOUS",
@"PERSONAL",
@"PROJECTS",
@"PUBLIC HOLIDAY",
@"STATUS",
@"SUPPLIERS",
@"TRAVEL",
@"VACATION",
nil];
[categoryItems retain];
}
categoryLabels = [[self labelForKey: @"category_labels"]
componentsSeparatedByString: @","];
categoryList
= [NSMutableArray arrayWithCapacity: [categoryLabels count] + 1];
if ([category length] && ![categoryLabels containsObject: category])
[categoryList addObject: category];
[categoryList addObjectsFromArray: categoryLabels];
max = [categoryItems count];
categoryList = [NSMutableArray arrayWithCapacity: max + 1];
for (count = 0; count < max; count++)
{
categoryItem = [categoryItems objectAtIndex: count];
newCategoryItem
= [self labelForKey: [NSString stringWithFormat: @"category_%@",
categoryItem]];
[categoryList addObject: newCategoryItem];
}
if ([categories count])
[categoryList addObjectsFromArray: categories];
return [[categoryList uniqueObjects]
sortedArrayUsingSelector: @selector (localizedCaseInsensitiveCompare:)];
return categoryList;
}
- (void) setCategories: (NSArray *) _categories