]> granicus.if.org Git - transmission/commitdiff
implement missing copyWithZone in TorrentCell
authorMitchell Livingston <livings124@transmissionbt.com>
Thu, 19 May 2011 22:01:16 +0000 (22:01 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Thu, 19 May 2011 22:01:16 +0000 (22:01 +0000)
macosx/TorrentCell.m

index a85acee1845c28b36dc10eec19c2a9d3c4f35e68..16f2ea110ff021a1d258de77ca9ed488881c990d 100644 (file)
        return self;
 }
 
+- (id) copyWithZone: (NSZone *) zone
+{
+    id value = [super copyWithZone: zone];
+    [value setRepresentedObject: [self representedObject]];
+    return value;
+}
+
 - (NSRect) iconRectForBounds: (NSRect) bounds
 {
     const CGFloat imageSize = [fDefaults boolForKey: @"SmallView"] ? IMAGE_SIZE_MIN : IMAGE_SIZE_REG;
 - (void) drawInteriorWithFrame: (NSRect) cellFrame inView: (NSView *) controlView
 {
     Torrent * torrent = [self representedObject];
+    NSAssert(torrent != nil, @"can't have a TorrentCell without a Torrent");
     
     const BOOL minimal = [fDefaults boolForKey: @"SmallView"];
     
 
 - (NSAttributedString *) attributedStatusString: (NSString *) string
 {
-    #warning we shouldn't have to do this
-    if (!string)
-        string = @"";
     return [[[NSAttributedString alloc] initWithString: string attributes: fStatusAttributes] autorelease];
 }