- (BOOL) setRatesWithDownload: (CGFloat) downloadRate upload: (CGFloat) uploadRate
{
//only needs update if the badges were displayed or are displayed now
- BOOL needsUpdate = fDownloadRate != downloadRate || fUploadRate != uploadRate;
- if (needsUpdate)
- {
- fDownloadRate = downloadRate;
- fUploadRate = uploadRate;
- }
+ if (fDownloadRate == downloadRate && fUploadRate == uploadRate)
+ return NO;
- return needsUpdate;
+ fDownloadRate = downloadRate;
+ fUploadRate = uploadRate;
+ return YES;
}
- (void) setQuitting
return;
}
- else if (fQuittingTiger)
+
+ if (fQuittingTiger)
return;
- else;
//set completed badge to top right
BOOL completedChange = fCompleted != fCompletedBadged;
NSEnumerator * enumerator = [fTorrents objectEnumerator];
while ((torrent = [enumerator nextObject]))
if (torrentStruct == [torrent torrentStruct])
+ {
+ [torrent retain];
break;
+ }
if (!torrent)
{
NSLog(@"No torrent found matching the given torrent struct from the RPC callback!");
return;
}
-
- [torrent retain];
}
switch (type)
visibleRect.size.height -= newY - visibleRect.origin.y;
visibleRect.origin.y = newY;
}
-
+
//remaining visible rows continue alternating
- CGFloat height = [self rowHeight] + [self intercellSpacing].height;
- NSInteger numberOfRects = ceil(visibleRect.size.height / height);
+ const CGFloat height = [self rowHeight] + [self intercellSpacing].height;
+ const NSInteger numberOfRects = ceil(visibleRect.size.height / height);
+
visibleRect.size.height = height;
+ if (start)
+ visibleRect.origin.y += height;
- for (NSInteger i=0; i<numberOfRects; i++)
+ for (NSInteger i = start ? 1 : 0; i<numberOfRects; i += 2)
{
- if (!start)
- NSRectFill(visibleRect);
-
- start = !start;
- visibleRect.origin.y += height;
+ NSRectFill(visibleRect);
+ visibleRect.origin.y += 2 * height;
}
[super highlightSelectionInClipRect: clipRect];
}
//remaining visible rows continue alternating
- CGFloat height = [self rowHeight] + [self intercellSpacing].height;
- NSInteger numberOfRects = ceil(visibleRect.size.height / height);
+ const CGFloat height = [self rowHeight] + [self intercellSpacing].height;
+ const NSInteger numberOfRects = ceil(visibleRect.size.height / height);
+
visibleRect.size.height = height;
+ if (start)
+ visibleRect.origin.y += height;
- for (NSInteger i=0; i<numberOfRects; i++)
+ for (NSInteger i = start ? 1 : 0; i<numberOfRects; i += 2)
{
- if (!start)
- NSRectFill(visibleRect);
-
- start = !start;
- visibleRect.origin.y += height;
+ NSRectFill(visibleRect);
+ visibleRect.origin.y += 2 * height;
}
[super highlightSelectionInClipRect: clipRect];