From 239fc6610b94c42b6b586050939def9443761b28 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sat, 8 Nov 2008 22:13:00 +0000 Subject: [PATCH] trivial changes to table grid color drawing and other areas --- macosx/BadgeView.m | 12 +++++------- macosx/Badger.m | 4 ++-- macosx/Controller.m | 5 +++-- macosx/TorrentTableView.m | 18 +++++++++--------- macosx/TrackerTableView.m | 16 ++++++++-------- 5 files changed, 27 insertions(+), 28 deletions(-) diff --git a/macosx/BadgeView.m b/macosx/BadgeView.m index e2d30e343..69d6a3ccb 100644 --- a/macosx/BadgeView.m +++ b/macosx/BadgeView.m @@ -57,14 +57,12 @@ - (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 diff --git a/macosx/Badger.m b/macosx/Badger.m index edbcf9c84..a7b20093e 100644 --- a/macosx/Badger.m +++ b/macosx/Badger.m @@ -96,9 +96,9 @@ return; } - else if (fQuittingTiger) + + if (fQuittingTiger) return; - else; //set completed badge to top right BOOL completedChange = fCompleted != fCompletedBadged; diff --git a/macosx/Controller.m b/macosx/Controller.m index 71e310caa..d6a5b9ef7 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -4229,7 +4229,10 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy NSEnumerator * enumerator = [fTorrents objectEnumerator]; while ((torrent = [enumerator nextObject])) if (torrentStruct == [torrent torrentStruct]) + { + [torrent retain]; break; + } if (!torrent) { @@ -4238,8 +4241,6 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy NSLog(@"No torrent found matching the given torrent struct from the RPC callback!"); return; } - - [torrent retain]; } switch (type) diff --git a/macosx/TorrentTableView.m b/macosx/TorrentTableView.m index 234b0608b..41a765b0a 100644 --- a/macosx/TorrentTableView.m +++ b/macosx/TorrentTableView.m @@ -738,19 +738,19 @@ 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