mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-07 22:38:51 +00:00
merge of '3b129c3c362bac1e7fdf67d93f24a6e9be27fdc1'
and 'e57c559e7f4acc6c125cef6398101fdf444f5d7b' Monotone-Parent: 3b129c3c362bac1e7fdf67d93f24a6e9be27fdc1 Monotone-Parent: e57c559e7f4acc6c125cef6398101fdf444f5d7b Monotone-Revision: bb2d11200e5d8cbdc9a740b2a9e019efed65432b Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-07-16T13:55:32 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -804,54 +804,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
|
||||
|
||||
Reference in New Issue
Block a user