]> granicus.if.org Git - transmission/commitdiff
explicit cast to Torrent * when calculating transfer name length
authorMitchell Livingston <livings124@transmissionbt.com>
Mon, 23 May 2011 00:45:17 +0000 (00:45 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Mon, 23 May 2011 00:45:17 +0000 (00:45 +0000)
macosx/TorrentCell.m

index 16f2ea110ff021a1d258de77ca9ed488881c990d..3fbf7d88a94512aafa741ea12caa4ba328c29abe 100644 (file)
         //take line out completely when 10.6-only
         priorityImage = [NSApp isOnSnowLeopardOrBetter] ? [priorityImage retain] : [priorityImage copy];
         
-        NSRect priorityRect = NSMakeRect(NSMaxX(titleRect) + PADDING_BETWEEN_TITLE_AND_PRIORITY,
-                                        NSMidY(titleRect) - PRIORITY_ICON_HEIGHT  * 0.5,
-                                        PRIORITY_ICON_WIDTH, PRIORITY_ICON_HEIGHT);
+        const NSRect priorityRect = NSMakeRect(NSMaxX(titleRect) + PADDING_BETWEEN_TITLE_AND_PRIORITY,
+                                               NSMidY(titleRect) - PRIORITY_ICON_HEIGHT  * 0.5,
+                                               PRIORITY_ICON_WIDTH, PRIORITY_ICON_HEIGHT);
         
         [self drawImage: priorityImage inRect: priorityRect];
         [priorityImage release];
         result.size.width = NSMaxX(bounds) - NSMinX(result) - PADDING_HORIZONTAL;
     }
     
-    if ([[self representedObject] priority] != TR_PRI_NORMAL)
+    if ([(Torrent *)[self representedObject] priority] != TR_PRI_NORMAL)
     {
         result.size.width -= PRIORITY_ICON_WIDTH + PADDING_BETWEEN_TITLE_AND_PRIORITY;
         result.size.width = MIN(NSWidth(result), [string size].width); //only need to force it smaller for the priority icon