Fixed sorting of timezones in preferences module.

Monotone-Parent: ee0810b737d9d978b856ca04e9102d7985d6bf82
Monotone-Revision: dfcee5ab2e9d3d65c64801fc45b75ab2a873cfce

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2011-03-24T14:43:52
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Francis Lachapelle 2011-03-24 14:43:52 +00:00
parent 73e41f02dd
commit 67d32dff9a
2 changed files with 5 additions and 6 deletions

View File

@ -49,6 +49,7 @@ static NSArray *knownTimeZones;
+ (void) initialize + (void) initialize
{ {
cache = [[NSMutableDictionary alloc] init]; cache = [[NSMutableDictionary alloc] init];
knownTimeZones = nil;
} }
+ (iCalTimeZone *) timeZoneForName: (NSString *) theName + (iCalTimeZone *) timeZoneForName: (NSString *) theName
@ -124,9 +125,7 @@ static NSArray *knownTimeZones;
NSRange ext; NSRange ext;
BOOL b; BOOL b;
timeZoneNames = knownTimeZones; if (!knownTimeZones)
if (!timeZoneNames)
{ {
timeZoneNames = [NSMutableArray new]; timeZoneNames = [NSMutableArray new];
@ -156,11 +155,11 @@ static NSArray *knownTimeZones;
} }
} }
} }
knownTimeZones = [timeZoneNames sortedArrayUsingSelector: @selector (localizedCaseInsensitiveCompare:)]; knownTimeZones = [NSArray arrayWithArray: timeZoneNames];
[knownTimeZones retain]; [knownTimeZones retain];
} }
return timeZoneNames; return knownTimeZones;
} }
- (Class) classForTag: (NSString *) classTag - (Class) classForTag: (NSString *) classTag

View File

@ -153,7 +153,7 @@
- (NSArray *) timeZonesList - (NSArray *) timeZonesList
{ {
return [iCalTimeZone knownTimeZoneNames]; return [[iCalTimeZone knownTimeZoneNames] sortedArrayUsingSelector: @selector (localizedCaseInsensitiveCompare:)];
} }
- (NSString *) userTimeZone - (NSString *) userTimeZone