]> granicus.if.org Git - transmission/commitdiff
trivial tweaks here and there
authorMitchell Livingston <livings124@transmissionbt.com>
Sat, 12 Dec 2009 18:52:03 +0000 (18:52 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Sat, 12 Dec 2009 18:52:03 +0000 (18:52 +0000)
NEWS
macosx/BadgeView.m
macosx/InfoWindowController.m
macosx/NSStringAdditions.m

diff --git a/NEWS b/NEWS
index 282a11b5d3ecc3e14b24c45c3af0eb6963a7a2d4..fb0b7e6f4b2111e99ca03f7ccb214c0fa7d64d7b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,7 @@
   * Fix 1.80 beta 1 crash when a malformed magnet link is given to Transmission
   * Better prefetching of local data that's being uploaded to peers
 ==== Mac ====
-  * Fix 1.80 beta 1 IPv6 port check issue on 10.6
+  * Fix 1.80 beta 1 IPv6 port check issue on Snow Leopard
   * Fix 1.80 beta 1 bug when pasting a URL into the torrent window
   * Updated Spanish, Italian, and Brazilian Portuguese localizations
 ==== GTK+ ====
index 27e76894118e6367921efbaac56d8c18dc396fec..6550a91aba572190e72b8097b3c5d93c23f82851 100644 (file)
     
     NSRect badgeRect;
     badgeRect.size = [badge size];
-    badgeRect.origin.x = 0;
+    badgeRect.origin.x = 0.0;
     badgeRect.origin.y = height;
     
     [badge drawInRect: badgeRect fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
     } while (NSWidth(badgeRect) < stringSize.width);
     
     //string is in center of image
-    NSRect stringRect = badgeRect;
-    stringRect.origin.x += (NSWidth(badgeRect) - stringSize.width) * 0.5;
-    stringRect.origin.y += (NSHeight(badgeRect) - stringSize.height) * 0.5 + (quit ? 2.0 : 1.0); //adjust for shadow, extra for quit
+    NSRect stringRect;
+    stringRect.origin.x = NSMinX(badgeRect) + (NSWidth(badgeRect) - stringSize.width) * 0.5;
+    stringRect.origin.y = NSMinY(badgeRect) + (NSHeight(badgeRect) - stringSize.height) * 0.5
+                            + (quit ? 2.0 : 1.0); //adjust for shadow, extra for quit
     stringRect.size = stringSize;
     
     [string drawInRect: stringRect withAttributes: fAttributes];
index ce8b05554bcffd1f415403e34a6ab8b09dd34915..5d8a5c44d2c1955ac6f80f9f05b41196b3b5f5ad 100644 (file)
@@ -1752,11 +1752,9 @@ typedef enum
     NSIndexSet * selectedIndexes = [fTrackerTable selectedRowIndexes];
     for (NSUInteger i=0, trackerIndex = 0; i <= [selectedIndexes lastIndex]; ++i)
     {
-        id item = [fTrackers objectAtIndex: i];
         const BOOL isSelected = [selectedIndexes containsIndex: i];
-        const BOOL isGroup = [item isKindOfClass: [NSNumber class]];
         
-        if (isGroup)
+        if ([[fTrackers objectAtIndex: i] isKindOfClass: [NSNumber class]])
         {
             if (isSelected)
             {
@@ -1773,6 +1771,8 @@ typedef enum
         }
     }
     
+    NSAssert([removeIndexes count] > 0, @"Trying to remove no trackers.");
+    
     if ([[NSUserDefaults standardUserDefaults] boolForKey: @"WarningRemoveTrackers"])
     {
         NSAlert * alert = [[NSAlert alloc] init];
index 2d5fcfb6ed3dcbb7eecaba3e541ea38c13fe5b8c..d445b15ac9059f7fcc43f4f9e0a39f83325fdcb9 100644 (file)
@@ -94,7 +94,7 @@
     else if (speed <= 999.95) //100.0 M to 999.9 M
         return [NSString localizedStringWithFormat: @"%.1f M", speed];
     else //insane speeds
-        return [NSString localizedStringWithFormat: @"%.2f G", (speed / 1024.0f)];
+        return [NSString localizedStringWithFormat: @"%.2f G", (speed / 1024.0)];
 }
 
 + (NSString *) stringForRatio: (CGFloat) ratio
         return [self localizedStandardCompare: string];
     else
     {
-        const NSInteger comparisonOptions = NSCaseInsensitiveSearch | NSNumericSearch | NSWidthInsensitiveSearch | NSForcedOrderingSearch;
+        const NSStringCompareOptions comparisonOptions = NSCaseInsensitiveSearch | NSNumericSearch | NSWidthInsensitiveSearch
+                                                            | NSForcedOrderingSearch;
         return [self compare: string options: comparisonOptions range: NSMakeRange(0, [self length]) locale: [NSLocale currentLocale]];
     }
 }
 
 - (NSComparisonResult) compareNumeric: (NSString *) string
 {
-    const NSInteger comparisonOptions = NSNumericSearch | NSForcedOrderingSearch;
+    const NSStringCompareOptions comparisonOptions = NSNumericSearch | NSForcedOrderingSearch;
     return [self compare: string options: comparisonOptions range: NSMakeRange(0, [self length]) locale: [NSLocale currentLocale]];
 }