sort by speed, then last activity

This commit is contained in:
Mitchell Livingston 2007-11-23 16:03:49 +00:00
parent ddc97a921b
commit 654af57b9c
6 changed files with 11 additions and 6 deletions

View File

@ -1632,10 +1632,12 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
descriptors = [[NSArray alloc] initWithObjects: orderDescriptor, nil];
else if ([sortType isEqualToString: SORT_ACTIVITY])
{
NSSortDescriptor * rateDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"totalRate" ascending: !asc]
autorelease];
NSSortDescriptor * activityDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"dateActivityOrAdd" ascending: !asc]
autorelease];
descriptors = [[NSArray alloc] initWithObjects: activityDescriptor, orderDescriptor, nil];
descriptors = [[NSArray alloc] initWithObjects: rateDescriptor, activityDescriptor, orderDescriptor, nil];
}
else
{

View File

@ -10,8 +10,7 @@
<integer>5</integer>
<key>IBOpenObjects</key>
<array>
<integer>2326</integer>
<integer>1895</integer>
<integer>1639</integer>
</array>
<key>IBSystem Version</key>
<string>9B18</string>

Binary file not shown.

View File

@ -24,8 +24,6 @@
#import "PrefsWindow.h"
#warning elliminate this class
@implementation PrefsWindow
- (void) keyDown: (NSEvent *) event

View File

@ -191,6 +191,7 @@ typedef enum
- (float) downloadRate;
- (float) uploadRate;
- (float) totalRate;
- (uint64_t) haveVerified;
- (uint64_t) haveTotal;
- (uint64_t) downloadedTotal;

View File

@ -1109,6 +1109,11 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
return fStat->rateUpload;
}
- (float) totalRate
{
return [self downloadRate] + [self uploadRate];
}
- (uint64_t) haveVerified
{
return fStat->haveValid;
@ -1461,7 +1466,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
fWaitToStart = waitToStart ? [waitToStart boolValue] : [fDefaults boolForKey: @"AutoStartDownload"];
[self setOrderValue: orderValue ? [orderValue intValue] : tr_torrentCount(fLib) - 1];
fOrderValue = orderValue ? [orderValue intValue] : tr_torrentCount(fLib) - 1;
fError = NO;
[self createFileList];