fix a crash on Tiger

This commit is contained in:
Mitchell Livingston 2008-01-27 19:10:14 +00:00
parent e6fa5577b6
commit 02799f7060
2 changed files with 14 additions and 11 deletions

View File

@ -1609,6 +1609,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
sortType = SORT_ORDER; sortType = SORT_ORDER;
[fDefaults setBool: NO forKey: @"SortReverse"]; [fDefaults setBool: NO forKey: @"SortReverse"];
[fDefaults setBool: NO forKey: @"SortByGroup"]; [fDefaults setBool: NO forKey: @"SortByGroup"];
[self updateDisplay: nil]; //ensure groups are removed [self updateDisplay: nil]; //ensure groups are removed
break; break;
case SORT_DATE_TAG: case SORT_DATE_TAG:

View File

@ -59,6 +59,8 @@
fDefaults = [NSUserDefaults standardUserDefaults]; fDefaults = [NSUserDefaults standardUserDefaults];
fTorrentCell = [[TorrentCell alloc] init]; fTorrentCell = [[TorrentCell alloc] init];
if (![NSApp isOnLeopardOrBetter])
[[self tableColumnWithIdentifier: @"Torrent"] setDataCell: fTorrentCell];
fMouseControlRow = -1; fMouseControlRow = -1;
fMouseRevealRow = -1; fMouseRevealRow = -1;
@ -76,9 +78,6 @@
- (void) awakeFromNib - (void) awakeFromNib
{ {
[self setGridStyleMask: NSTableViewSolidVerticalGridLineMask]; //weird redrawing issues if set to none [self setGridStyleMask: NSTableViewSolidVerticalGridLineMask]; //weird redrawing issues if set to none
if (![NSApp isOnLeopardOrBetter])
[[self tableColumnWithIdentifier: @"Torrent"] setDataCell: fTorrentCell];
} }
- (void) dealloc - (void) dealloc
@ -745,19 +744,22 @@
- (void) resizePiecesBarIncrement - (void) resizePiecesBarIncrement
{ {
BOOL increase = [fDefaults boolForKey: @"PiecesBar"]; BOOL done;
if ([fDefaults boolForKey: @"PiecesBar"])
if (increase) {
fPiecesBarPercent += PIECE_INCREASE; fPiecesBarPercent = MIN(fPiecesBarPercent + PIECE_INCREASE, 1.0);
done = fPiecesBarPercent == 1.0;
}
else else
fPiecesBarPercent -= PIECE_INCREASE; {
fPiecesBarPercent = MAX(fPiecesBarPercent - PIECE_INCREASE, 0.0);
done = fPiecesBarPercent == 0.0;
}
if (increase ? (fPiecesBarPercent >= 1.0) : (fPiecesBarPercent <= 0.0)) if (done)
{ {
[fPiecesBarTimer invalidate]; [fPiecesBarTimer invalidate];
fPiecesBarTimer = nil; fPiecesBarTimer = nil;
fPiecesBarPercent = increase ? 1.0 : 0.0;
} }
[self reloadData]; [self reloadData];