if a transfer is checking decrease the queue count for both queues but don't start the transfer
This commit is contained in:
parent
b6819d6a12
commit
19c7d8367a
|
@ -1410,7 +1410,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
NSEnumerator * enumerator = [sortedTorrents objectEnumerator];
|
NSEnumerator * enumerator = [sortedTorrents objectEnumerator];
|
||||||
while ((torrent = [enumerator nextObject]))
|
while ((torrent = [enumerator nextObject]))
|
||||||
{
|
{
|
||||||
if (![torrent isActive] && [torrent waitingToStart])
|
if (![torrent isActive] && ![torrent isChecking] && [torrent waitingToStart])
|
||||||
{
|
{
|
||||||
if (![torrent allDownloaded])
|
if (![torrent allDownloaded])
|
||||||
{
|
{
|
||||||
|
@ -1450,7 +1450,14 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
Torrent * torrent;
|
Torrent * torrent;
|
||||||
NSEnumerator * enumerator = [fTorrents objectEnumerator];
|
NSEnumerator * enumerator = [fTorrents objectEnumerator];
|
||||||
while ((torrent = [enumerator nextObject]))
|
while ((torrent = [enumerator nextObject]))
|
||||||
if ([torrent isActive] && ![torrent isStalled] && ![torrent isError])
|
{
|
||||||
|
if ([torrent isChecking])
|
||||||
|
{
|
||||||
|
desired--;
|
||||||
|
if (desired <= 0)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else if ([torrent isActive] && ![torrent isStalled] && ![torrent isError])
|
||||||
{
|
{
|
||||||
if ([torrent allDownloaded] != downloadQueue)
|
if ([torrent allDownloaded] != downloadQueue)
|
||||||
{
|
{
|
||||||
|
@ -1459,6 +1466,8 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else;
|
||||||
|
}
|
||||||
|
|
||||||
return desired;
|
return desired;
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,7 +163,6 @@
|
||||||
- (BOOL) isActive;
|
- (BOOL) isActive;
|
||||||
- (BOOL) isSeeding;
|
- (BOOL) isSeeding;
|
||||||
- (BOOL) isPaused;
|
- (BOOL) isPaused;
|
||||||
- (BOOL) isWaitingToChecking;
|
|
||||||
- (BOOL) isChecking;
|
- (BOOL) isChecking;
|
||||||
- (BOOL) allDownloaded;
|
- (BOOL) allDownloaded;
|
||||||
- (BOOL) isError;
|
- (BOOL) isError;
|
||||||
|
|
|
@ -486,7 +486,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
||||||
if ((wasChecking && !fChecking) || (!wasStalled && fStalled) || (!wasError && fError && [self isActive]))
|
if ((wasChecking && !fChecking) || (!wasStalled && fStalled) || (!wasError && fError && [self isActive]))
|
||||||
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateQueue" object: self];
|
[[NSNotificationCenter defaultCenter] postNotificationName: @"UpdateQueue" object: self];
|
||||||
|
|
||||||
if ([self isActive] && ![self isChecking] && ![self isWaitingToChecking] )
|
if ([self isActive] && ![self isChecking])
|
||||||
{
|
{
|
||||||
NSString * stringToAppend = @"";
|
NSString * stringToAppend = @"";
|
||||||
if (![self allDownloaded])
|
if (![self allDownloaded])
|
||||||
|
@ -1079,14 +1079,9 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
||||||
return fStat->status == TR_STATUS_STOPPED;
|
return fStat->status == TR_STATUS_STOPPED;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) isWaitingToChecking
|
|
||||||
{
|
|
||||||
return fStat->status == TR_STATUS_CHECK_WAIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL) isChecking
|
- (BOOL) isChecking
|
||||||
{
|
{
|
||||||
return fStat->status == TR_STATUS_CHECK;
|
return fStat->status == TR_STATUS_CHECK || fStat->status == TR_STATUS_CHECK_WAIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) allDownloaded
|
- (BOOL) allDownloaded
|
||||||
|
|
Loading…
Reference in New Issue