sort by state will sort by progress afterwards

This commit is contained in:
Mitchell Livingston 2006-06-20 14:46:15 +00:00
parent e1cf898983
commit 8f9ca03e98
1 changed files with 6 additions and 6 deletions

View File

@ -790,7 +790,10 @@ static void sleepCallBack( void * controller, io_service_t y,
NSSortDescriptor * nameDescriptor = [[[NSSortDescriptor alloc] initWithKey:
@"name" ascending: YES] autorelease],
* dateDescriptor = [[[NSSortDescriptor alloc] initWithKey:
@"date" ascending: YES] autorelease];
@"date" ascending: YES] autorelease],
* progressDescriptor = [[[NSSortDescriptor alloc] initWithKey:
@"progressSortKey" ascending: YES] autorelease];
NSArray * descriptors;
if ([fSortType isEqualToString: @"Name"])
descriptors = [[NSArray alloc] initWithObjects: nameDescriptor, dateDescriptor, nil];
@ -798,14 +801,11 @@ static void sleepCallBack( void * controller, io_service_t y,
{
NSSortDescriptor * stateDescriptor = [[[NSSortDescriptor alloc] initWithKey:
@"stateSortKey" ascending: NO] autorelease];
descriptors = [[NSArray alloc] initWithObjects: stateDescriptor, nameDescriptor, dateDescriptor, nil];
descriptors = [[NSArray alloc] initWithObjects: stateDescriptor, progressDescriptor,
nameDescriptor, dateDescriptor, nil];
}
else if ([fSortType isEqualToString: @"Progress"])
{
NSSortDescriptor * progressDescriptor = [[[NSSortDescriptor alloc] initWithKey:
@"progressSortKey" ascending: YES] autorelease];
descriptors = [[NSArray alloc] initWithObjects: progressDescriptor, nameDescriptor, dateDescriptor, nil];
}
else
descriptors = [[NSArray alloc] initWithObjects: dateDescriptor, nameDescriptor, nil];