- Timestamp:
- 09/29/08 23:42:07 (16 years ago)
- Location:
- Trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
Trunk/ABSortByLogSizePlugin.m
r11 r15 41 41 - (NSString *)pluginDescription 42 42 { 43 return @"Allows the contact list to be sorted bytranscript file size.";43 return @"Allows the Adium contact list to be sorted by chat transcript file size."; 44 44 } 45 45 -
Trunk/AILogSizeSort.m
r11 r15 175 175 } 176 176 177 unsigned long long sizeA = [AILogSizeSort getContactLogSize:objectA]; 178 unsigned long long sizeB = [AILogSizeSort getContactLogSize:objectB]; 177 179 178 NSNumber *sizeA = [NSNumber numberWithUnsignedLongLong:[AILogSizeSort getContactLogSize:objectA]]; 179 NSNumber *sizeB = [NSNumber numberWithUnsignedLongLong:[AILogSizeSort getContactLogSize:objectB]]; 180 181 if([sizeB compare:sizeA] == NSOrderedSame) 180 if(sizeB == sizeA) 182 181 { 183 182 // Fall back to basic alphabetical sorting in the event of a tie. 184 183 return [[objectA displayName] caseInsensitiveCompare:[objectB displayName]]; 185 184 } 185 else if(sizeA > sizeB) 186 { 187 // There's a clear winner; run with it. 188 return NSOrderedAscending; 189 } 186 190 else 187 191 { 188 // There's a clear winner; run with it. 189 return [sizeB compare:sizeA]; 192 return NSOrderedDescending; 190 193 } 191 194 }