mirror of
https://github.com/transmission/transmission
synced 2025-02-20 13:16:53 +00:00
remove temporary asserts
This commit is contained in:
parent
496e86cbac
commit
78f6a488d5
6 changed files with 5 additions and 23 deletions
|
@ -105,7 +105,6 @@
|
|||
|
||||
- (NSIndexSet *) indexes
|
||||
{
|
||||
NSAssert(fIndexes != nil, @"How did this get nil? - temp");
|
||||
return fIndexes;
|
||||
}
|
||||
|
||||
|
|
|
@ -119,9 +119,6 @@
|
|||
[image drawInRect: [self imageRectForBounds: cellFrame] fromRect: NSZeroRect operation: NSCompositeSourceOver fraction: 1.0];
|
||||
}
|
||||
|
||||
NSIndexSet * indexSet = [(FileListNode *)[self objectValue] indexes];
|
||||
NSAssert(indexSet != nil, @"indexSet must not be nil - temp");
|
||||
|
||||
NSColor * titleColor, * statusColor;
|
||||
if ([self backgroundStyle] == NSBackgroundStyleDark)
|
||||
titleColor = statusColor = [NSColor whiteColor];
|
||||
|
|
|
@ -161,11 +161,7 @@ typedef enum
|
|||
- (id) outlineView: (NSOutlineView *) outlineView objectValueForTableColumn: (NSTableColumn *) tableColumn byItem: (id) item
|
||||
{
|
||||
if ([[tableColumn identifier] isEqualToString: @"Check"])
|
||||
{
|
||||
NSIndexSet * indexSet = [(FileListNode *)item indexes];
|
||||
NSAssert(indexSet != nil, @"indexSet must not be nil - temp");
|
||||
return [NSNumber numberWithInteger: [fTorrent checkForFiles: [(FileListNode *)item indexes]]];
|
||||
}
|
||||
else
|
||||
return item;
|
||||
}
|
||||
|
@ -175,11 +171,7 @@ typedef enum
|
|||
{
|
||||
NSString * identifier = [tableColumn identifier];
|
||||
if ([identifier isEqualToString: @"Check"])
|
||||
{
|
||||
NSIndexSet * indexSet = [(FileListNode *)item indexes];
|
||||
NSAssert(indexSet != nil, @"indexSet must not be nil - temp");
|
||||
[cell setEnabled: [fTorrent canChangeDownloadCheckForFiles: [(FileListNode *)item indexes]]];
|
||||
}
|
||||
else if ([identifier isEqualToString: @"Priority"])
|
||||
{
|
||||
[cell setRepresentedObject: item];
|
||||
|
@ -375,7 +367,6 @@ typedef enum
|
|||
[itemIndexes addIndexes: [[fOutline itemAtRow: i] indexes]];
|
||||
|
||||
NSInteger state = ([menuItem tag] == FILE_CHECK_TAG) ? NSOnState : NSOffState;
|
||||
NSAssert(itemIndexes != nil, @"indexSet must not be nil - temp");
|
||||
return [fTorrent checkForFiles: itemIndexes] != state && [fTorrent canChangeDownloadCheckForFiles: itemIndexes];
|
||||
}
|
||||
|
||||
|
@ -389,7 +380,6 @@ typedef enum
|
|||
for (NSInteger i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i])
|
||||
[itemIndexes addIndexes: [[fOutline itemAtRow: i] indexes]];
|
||||
|
||||
NSAssert(itemIndexes != nil, @"indexSet must not be nil - temp");
|
||||
return [fTorrent canChangeDownloadCheckForFiles: itemIndexes];
|
||||
}
|
||||
|
||||
|
@ -421,7 +411,6 @@ typedef enum
|
|||
for (NSInteger i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i])
|
||||
{
|
||||
NSIndexSet * fileIndexSet = [[fOutline itemAtRow: i] indexes];
|
||||
NSAssert(fileIndexSet != nil, @"indexSet must not be nil - temp");
|
||||
if (![fTorrent canChangeDownloadCheckForFiles: fileIndexSet])
|
||||
continue;
|
||||
|
||||
|
|
|
@ -184,7 +184,6 @@
|
|||
{
|
||||
NSDictionary * item = [self itemAtRow: row];
|
||||
NSIndexSet * indexes = [(FileListNode *)item indexes];
|
||||
NSAssert(indexes != nil, @"indexSet must not be nil - temp");
|
||||
|
||||
if ([fTorrent checkForFiles: indexes] != NSOffState)
|
||||
{
|
||||
|
|
|
@ -1348,8 +1348,6 @@ int trashDataFile(const char * filename)
|
|||
|
||||
- (NSInteger) checkForFiles: (NSIndexSet *) indexSet
|
||||
{
|
||||
NSAssert(indexSet != nil, @"indexSet must not be nil");
|
||||
|
||||
BOOL onState = NO, offState = NO;
|
||||
for (NSUInteger index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
|
||||
{
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
|
||||
[self setDelegate: self];
|
||||
|
||||
fPiecesBarPercent = [fDefaults boolForKey: @"PiecesBar"] ? 1.0f : 0.0f;
|
||||
fPiecesBarPercent = [fDefaults boolForKey: @"PiecesBar"] ? 1.0 : 0.0;
|
||||
}
|
||||
|
||||
return self;
|
||||
|
@ -616,9 +616,9 @@
|
|||
NSMenuItem * item;
|
||||
if ([menu numberOfItems] == 4)
|
||||
{
|
||||
const CGFloat ratioLimitActionValue[] = { 0.25f, 0.5f, 0.75f, 1.0f, 1.5f, 2.0f, 3.0f, -1.0f };
|
||||
const CGFloat ratioLimitActionValue[] = { 0.25, 0.5, 0.75, 1.0, 1.5, 2.0, 3.0, -1.0 };
|
||||
|
||||
for (NSInteger i = 0; ratioLimitActionValue[i] != -1.0f; i++)
|
||||
for (NSInteger i = 0; ratioLimitActionValue[i] != -1.0; i++)
|
||||
{
|
||||
item = [[NSMenuItem alloc] initWithTitle: [NSString localizedStringWithFormat: @"%.2f", ratioLimitActionValue[i]]
|
||||
action: @selector(setQuickRatio:) keyEquivalent: @""];
|
||||
|
@ -821,7 +821,7 @@
|
|||
[fPiecesBarAnimation release];
|
||||
|
||||
NSMutableArray * progressMarks = [NSMutableArray arrayWithCapacity: 16];
|
||||
for (NSAnimationProgress i = 0.0625f; i <= 1.0f; i += 0.0625f)
|
||||
for (NSAnimationProgress i = 0.0625; i <= 1.0; i += 0.0625)
|
||||
[progressMarks addObject: [NSNumber numberWithFloat: i]];
|
||||
|
||||
fPiecesBarAnimation = [[NSAnimation alloc] initWithDuration: TOGGLE_PROGRESS_SECONDS animationCurve: NSAnimationEaseIn];
|
||||
|
@ -848,7 +848,7 @@
|
|||
if ([fDefaults boolForKey: @"PiecesBar"])
|
||||
fPiecesBarPercent = progress;
|
||||
else
|
||||
fPiecesBarPercent = 1.0f - progress;
|
||||
fPiecesBarPercent = 1.0 - progress;
|
||||
|
||||
[self reloadData];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue