get rid of another warning

This commit is contained in:
Mitchell Livingston
2007-09-22 12:50:51 +00:00
parent ea7513e59d
commit e34218bd45
3 changed files with 10 additions and 7 deletions

View File

@@ -1681,10 +1681,12 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
{
NSSortDescriptor * progressDescriptor = [[[NSSortDescriptor alloc] initWithKey:
@"progressSortKey" ascending: asc] autorelease],
* ratioProgressDescriptor = [[[NSSortDescriptor alloc] initWithKey:
@"ratioProgressSortKey" ascending: asc] autorelease],
* ratioDescriptor = [[[NSSortDescriptor alloc] initWithKey:
@"ratioSortKey" ascending: asc] autorelease];
descriptors = [[NSArray alloc] initWithObjects: progressDescriptor, ratioDescriptor,
descriptors = [[NSArray alloc] initWithObjects: progressDescriptor, ratioProgressDescriptor, ratioDescriptor,
nameDescriptor, orderDescriptor, nil];
}
else if ([sortType isEqualToString: SORT_TRACKER])

View File

@@ -225,6 +225,7 @@ typedef enum
- (NSNumber *) stateSortKey;
- (NSNumber *) progressSortKey;
- (NSNumber *) ratioSortKey;
- (NSNumber *) ratioProgressSortKey;
- (int) torrentID;
- (const tr_info *) torrentInfo;

View File

@@ -1375,14 +1375,9 @@ static int static_lastid = 0;
return [NSNumber numberWithInt: 2];
}
#warning is progress different when seeding?
- (NSNumber *) progressSortKey
{
float progress;
if ((progress = [self progress]) >= 1.0)
progress += [self progressStopRatio];
return [NSNumber numberWithFloat: progress];
return [NSNumber numberWithFloat: [self progress]];
}
- (NSNumber *) ratioSortKey
@@ -1390,6 +1385,11 @@ static int static_lastid = 0;
return [NSNumber numberWithFloat: [self ratio]];
}
- (NSNumber *) ratioProgressSortKey
{
return [NSNumber numberWithFloat: [self progressStopRatio]];
}
- (int) torrentID
{
return fID;