mirror of
https://github.com/transmission/transmission
synced 2025-01-30 10:52:00 +00:00
Complete copyWithZone for TorrentCell (#5079)
This commit is contained in:
parent
848212eea1
commit
264437d6d9
2 changed files with 16 additions and 8 deletions
|
@ -37,9 +37,9 @@ static CGFloat const kImageOverlap = 1.0;
|
|||
|
||||
- (id)copyWithZone:(NSZone*)zone
|
||||
{
|
||||
id value = [super copyWithZone:zone];
|
||||
[value setRepresentedObject:self.representedObject];
|
||||
return value;
|
||||
FilePriorityCell* copy = [super copyWithZone:zone];
|
||||
[copy setRepresentedObject:self.representedObject];
|
||||
return copy;
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)flag forSegment:(NSInteger)segment
|
||||
|
|
|
@ -79,8 +79,6 @@ static NSInteger const kMaxPieces = 18 * 18;
|
|||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
_fDefaults = NSUserDefaults.standardUserDefaults;
|
||||
|
||||
NSMutableParagraphStyle* paragraphStyle = [NSParagraphStyle.defaultParagraphStyle mutableCopy];
|
||||
paragraphStyle.lineBreakMode = NSLineBreakByTruncatingMiddle;
|
||||
|
||||
|
@ -101,9 +99,19 @@ static NSInteger const kMaxPieces = 18 * 18;
|
|||
|
||||
- (id)copyWithZone:(NSZone*)zone
|
||||
{
|
||||
id value = [super copyWithZone:zone];
|
||||
[value setRepresentedObject:self.representedObject];
|
||||
return value;
|
||||
TorrentCell* copy = [super copyWithZone:zone];
|
||||
copy->_fTitleAttributes = [_fTitleAttributes mutableCopyWithZone:zone];
|
||||
copy->_fStatusAttributes = [_fStatusAttributes mutableCopyWithZone:zone];
|
||||
copy->_fBluePieceColor = _fBluePieceColor;
|
||||
copy->_fBarBorderColor = _fBarBorderColor;
|
||||
copy->_fBarMinimalBorderColor = _fBarMinimalBorderColor;
|
||||
[copy setRepresentedObject:self.representedObject];
|
||||
return copy;
|
||||
}
|
||||
|
||||
- (NSUserDefaults*)fDefaults
|
||||
{
|
||||
return NSUserDefaults.standardUserDefaults;
|
||||
}
|
||||
|
||||
- (NSRect)iconRectForBounds:(NSRect)bounds
|
||||
|
|
Loading…
Reference in a new issue