don't allow single-file torrents to have priority/download check changed
This commit is contained in:
parent
714a43d242
commit
eef469a3de
|
@ -1338,7 +1338,8 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
||||||
int index;
|
int index;
|
||||||
for (index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
|
for (index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
|
||||||
{
|
{
|
||||||
if (tr_torrentGetFilePriority(fHandle, index) != TR_PRI_DND || [self fileProgress: index] >= 1.0)
|
if (tr_torrentGetFilePriority(fHandle, index) != TR_PRI_DND
|
||||||
|
|| [self canChangeDownloadCheckForFiles: [NSIndexSet indexSetWithIndex: index]])
|
||||||
onState = YES;
|
onState = YES;
|
||||||
else
|
else
|
||||||
offState = YES;
|
offState = YES;
|
||||||
|
@ -1351,6 +1352,9 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
||||||
|
|
||||||
- (BOOL) canChangeDownloadCheckForFiles: (NSIndexSet *) indexSet
|
- (BOOL) canChangeDownloadCheckForFiles: (NSIndexSet *) indexSet
|
||||||
{
|
{
|
||||||
|
if ([self fileCount] <= 1)
|
||||||
|
return NO;
|
||||||
|
|
||||||
int index;
|
int index;
|
||||||
for (index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
|
for (index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
|
||||||
if ([self fileProgress: index] < 1.0)
|
if ([self fileProgress: index] < 1.0)
|
||||||
|
@ -1413,7 +1417,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
||||||
int index;
|
int index;
|
||||||
for (index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
|
for (index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
|
||||||
if (priority == [[[fFlatFileList objectAtIndex: index] objectForKey: @"Priority"] intValue]
|
if (priority == [[[fFlatFileList objectAtIndex: index] objectForKey: @"Priority"] intValue]
|
||||||
&& [self fileProgress: index] < 1.0)
|
&& [self canChangeDownloadCheckForFiles: [NSIndexSet indexSetWithIndex: index]])
|
||||||
return YES;
|
return YES;
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue