]> granicus.if.org Git - transmission/commitdiff
use 10.6's localizedStandardCompare: when sorting by name
authorMitchell Livingston <livings124@transmissionbt.com>
Wed, 16 Sep 2009 02:18:23 +0000 (02:18 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Wed, 16 Sep 2009 02:18:23 +0000 (02:18 +0000)
macosx/InfoWindowController.m
macosx/NSStringAdditions.m

index 6a860e06a8e05ca6dd85253079f5ccadb086cbee..8c4cd1a097b3d12e920a7c30259f55c937a358a9 100644 (file)
@@ -410,7 +410,6 @@ typedef enum
             [fImageView setImage: icon];
             [icon release];
         }
-
         
         NSString * name = [torrent name];
         [fNameField setStringValue: name];
index 5eab6d73840c6892c6d5331ebbf4bb3be31d68d8..405211b39b267f7424fba9a680b8d581cdf068ef 100644 (file)
@@ -23,6 +23,7 @@
  *****************************************************************************/
 
 #import "NSStringAdditions.h"
+#import "NSApplicationAdditions.h"
 #import "utils.h"
 #import <transmission.h>
 
 
 - (NSComparisonResult) compareFinder: (NSString *) string
 {
-    const NSInteger comparisonOptions = NSCaseInsensitiveSearch | NSNumericSearch | NSWidthInsensitiveSearch | NSForcedOrderingSearch;
-    return [self compare: string options: comparisonOptions range: NSMakeRange(0, [self length]) locale: [NSLocale currentLocale]];
+    if ([NSApp isOnSnowLeopardOrBetter])
+        return [self localizedStandardCompare: string];
+    else
+    {
+        const NSInteger comparisonOptions = NSCaseInsensitiveSearch | NSNumericSearch | NSWidthInsensitiveSearch | NSForcedOrderingSearch;
+        return [self compare: string options: comparisonOptions range: NSMakeRange(0, [self length]) locale: [NSLocale currentLocale]];
+    }
 }
 
 - (NSComparisonResult) compareNumeric: (NSString *) string