when sorting by last activity, if there was no activity use date
This commit is contained in:
parent
3b04f824e0
commit
f657bd524b
|
@ -1632,10 +1632,10 @@ 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 * activityDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"dateActivity" ascending: !asc] autorelease],
|
||||
* dateDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"dateAdded" ascending: !asc] autorelease];
|
||||
NSSortDescriptor * activityDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"dateActivityOrAdd" ascending: !asc]
|
||||
autorelease];
|
||||
|
||||
descriptors = [[NSArray alloc] initWithObjects: activityDescriptor, dateDescriptor, orderDescriptor, nil];
|
||||
descriptors = [[NSArray alloc] initWithObjects: activityDescriptor, orderDescriptor, nil];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -223,6 +223,7 @@ typedef enum
|
|||
- (NSDate *) dateAdded;
|
||||
- (NSDate *) dateCompleted;
|
||||
- (NSDate *) dateActivity;
|
||||
- (NSDate *) dateActivityOrAdd;
|
||||
|
||||
- (int) stalledMinutes;
|
||||
- (BOOL) isStalled;
|
||||
|
|
|
@ -1332,6 +1332,12 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
|
|||
return date != 0 ? [NSDate dateWithTimeIntervalSince1970: date / 1000] : fDateActivity;
|
||||
}
|
||||
|
||||
- (NSDate *) dateActivityOrAdd
|
||||
{
|
||||
NSDate * date = [self dateActivity];
|
||||
return date ? date : [self dateAdded];
|
||||
}
|
||||
|
||||
- (int) stalledMinutes
|
||||
{
|
||||
uint64_t start;
|
||||
|
|
Loading…
Reference in New Issue