mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
(trunk) #2894 "tr_torrentGetFileDL() and tr_torrentGetFilePriority() should go away" -- get rid of it in the mac client and libtransmission too
This commit is contained in:
@@ -1735,23 +1735,6 @@ tr_torrentSetFilePriorities( tr_torrent * tor,
|
||||
tr_torrentUnlock( tor );
|
||||
}
|
||||
|
||||
tr_priority_t
|
||||
tr_torrentGetFilePriority( const tr_torrent * tor,
|
||||
tr_file_index_t file )
|
||||
{
|
||||
tr_priority_t ret;
|
||||
|
||||
assert( tr_isTorrent( tor ) );
|
||||
|
||||
tr_torrentLock( tor );
|
||||
assert( tor );
|
||||
assert( file < tor->info.fileCount );
|
||||
ret = tor->info.files[file].priority;
|
||||
tr_torrentUnlock( tor );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
tr_priority_t*
|
||||
tr_torrentGetFilePriorities( const tr_torrent * tor )
|
||||
{
|
||||
@@ -1773,23 +1756,6 @@ tr_torrentGetFilePriorities( const tr_torrent * tor )
|
||||
*** File DND
|
||||
**/
|
||||
|
||||
int
|
||||
tr_torrentGetFileDL( const tr_torrent * tor,
|
||||
tr_file_index_t file )
|
||||
{
|
||||
int doDownload;
|
||||
|
||||
assert( tr_isTorrent( tor ) );
|
||||
|
||||
tr_torrentLock( tor );
|
||||
|
||||
assert( file < tor->info.fileCount );
|
||||
doDownload = !tor->info.files[file].dnd;
|
||||
|
||||
tr_torrentUnlock( tor );
|
||||
return doDownload != 0;
|
||||
}
|
||||
|
||||
static void
|
||||
setFileDND( tr_torrent * tor, tr_file_index_t fileIndex, int doDownload )
|
||||
{
|
||||
|
||||
@@ -1168,20 +1168,6 @@ void tr_torrentSetFilePriorities( tr_torrent * torrent,
|
||||
*/
|
||||
tr_priority_t* tr_torrentGetFilePriorities( const tr_torrent * torrent );
|
||||
|
||||
/**
|
||||
* @brief Single-file form of tr_torrentGetFilePriorities.
|
||||
* @return TR_PRI_NORMAL, TR_PRI_HIGH, or TR_PRI_LOW.
|
||||
*/
|
||||
tr_priority_t tr_torrentGetFilePriority( const tr_torrent * torrent,
|
||||
tr_file_index_t file );
|
||||
|
||||
/**
|
||||
* @brief See if a file's `download' flag is set.
|
||||
* @return true if the file's `download' flag is set.
|
||||
*/
|
||||
int tr_torrentGetFileDL( const tr_torrent * torrent,
|
||||
tr_file_index_t file );
|
||||
|
||||
/** @brief Set a batch of files to be downloaded or not. */
|
||||
void tr_torrentSetFileDLs( tr_torrent * torrent,
|
||||
tr_file_index_t * files,
|
||||
|
||||
+3
-3
@@ -1340,7 +1340,7 @@ int trashDataFile(const char * filename)
|
||||
BOOL onState = NO, offState = NO;
|
||||
for (NSUInteger index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
|
||||
{
|
||||
if (tr_torrentGetFileDL(fHandle, index) || ![self canChangeDownloadCheckForFile: index])
|
||||
if ( !fInfo->files[index].dnd || ![self canChangeDownloadCheckForFile: index])
|
||||
onState = YES;
|
||||
else
|
||||
offState = YES;
|
||||
@@ -1379,7 +1379,7 @@ int trashDataFile(const char * filename)
|
||||
- (BOOL) hasFilePriority: (tr_priority_t) priority forIndexes: (NSIndexSet *) indexSet
|
||||
{
|
||||
for (NSUInteger index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
|
||||
if (priority == tr_torrentGetFilePriority(fHandle, index) && [self canChangeDownloadCheckForFile: index])
|
||||
if ((priority == fInfo->files[index].priority) && [self canChangeDownloadCheckForFile: index])
|
||||
return YES;
|
||||
return NO;
|
||||
}
|
||||
@@ -1394,7 +1394,7 @@ int trashDataFile(const char * filename)
|
||||
if (![self canChangeDownloadCheckForFile: index])
|
||||
continue;
|
||||
|
||||
const tr_priority_t priority = tr_torrentGetFilePriority(fHandle, index);
|
||||
const tr_priority_t priority = fInfo->files[index].priority;
|
||||
if (priority == TR_PRI_LOW)
|
||||
{
|
||||
if (low)
|
||||
|
||||
Reference in New Issue
Block a user