(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:
Charles Kerr
2010-02-11 15:05:07 +00:00
parent 33e116f971
commit b7b5a0e427
3 changed files with 3 additions and 51 deletions
-34
View File
@@ -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 )
{
-14
View File
@@ -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
View File
@@ -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)