Ignore:
Timestamp:
Sep 16, 2009, 2:18:23 AM (13 years ago)
Author:
livings124
Message:

use 10.6's localizedStandardCompare: when sorting by name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/NSStringAdditions.m

    r8029 r9124  
    2424
    2525#import "NSStringAdditions.h"
     26#import "NSApplicationAdditions.h"
    2627#import "utils.h"
    2728#import <transmission.h>
     
    142143- (NSComparisonResult) compareFinder: (NSString *) string
    143144{
    144     const NSInteger comparisonOptions = NSCaseInsensitiveSearch | NSNumericSearch | NSWidthInsensitiveSearch | NSForcedOrderingSearch;
    145     return [self compare: string options: comparisonOptions range: NSMakeRange(0, [self length]) locale: [NSLocale currentLocale]];
     145    if ([NSApp isOnSnowLeopardOrBetter])
     146        return [self localizedStandardCompare: string];
     147    else
     148    {
     149        const NSInteger comparisonOptions = NSCaseInsensitiveSearch | NSNumericSearch | NSWidthInsensitiveSearch | NSForcedOrderingSearch;
     150        return [self compare: string options: comparisonOptions range: NSMakeRange(0, [self length]) locale: [NSLocale currentLocale]];
     151    }
    146152}
    147153
Note: See TracChangeset for help on using the changeset viewer.