Changeset 10174


Ignore:
Timestamp:
Feb 11, 2010, 3:05:07 PM (12 years ago)
Author:
charles
Message:

(trunk) #2894 "tr_torrentGetFileDL() and tr_torrentGetFilePriority() should go away" -- get rid of it in the mac client and libtransmission too

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r10160 r10174  
    17361736}
    17371737
    1738 tr_priority_t
    1739 tr_torrentGetFilePriority( const tr_torrent * tor,
    1740                            tr_file_index_t    file )
    1741 {
    1742     tr_priority_t ret;
    1743 
    1744     assert( tr_isTorrent( tor ) );
    1745 
    1746     tr_torrentLock( tor );
    1747     assert( tor );
    1748     assert( file < tor->info.fileCount );
    1749     ret = tor->info.files[file].priority;
    1750     tr_torrentUnlock( tor );
    1751 
    1752     return ret;
    1753 }
    1754 
    17551738tr_priority_t*
    17561739tr_torrentGetFilePriorities( const tr_torrent * tor )
     
    17731756***  File DND
    17741757**/
    1775 
    1776 int
    1777 tr_torrentGetFileDL( const tr_torrent * tor,
    1778                      tr_file_index_t    file )
    1779 {
    1780     int doDownload;
    1781 
    1782     assert( tr_isTorrent( tor ) );
    1783 
    1784     tr_torrentLock( tor );
    1785 
    1786     assert( file < tor->info.fileCount );
    1787     doDownload = !tor->info.files[file].dnd;
    1788 
    1789     tr_torrentUnlock( tor );
    1790     return doDownload != 0;
    1791 }
    17921758
    17931759static void
  • trunk/libtransmission/transmission.h

    r10099 r10174  
    11691169tr_priority_t*  tr_torrentGetFilePriorities( const tr_torrent * torrent );
    11701170
    1171 /**
    1172  * @brief Single-file form of tr_torrentGetFilePriorities.
    1173  * @return TR_PRI_NORMAL, TR_PRI_HIGH, or TR_PRI_LOW.
    1174  */
    1175 tr_priority_t   tr_torrentGetFilePriority( const tr_torrent  * torrent,
    1176                                            tr_file_index_t     file );
    1177 
    1178 /**
    1179  * @brief See if a file's `download' flag is set.
    1180  * @return true if the file's `download' flag is set.
    1181  */
    1182 int tr_torrentGetFileDL( const tr_torrent  * torrent,
    1183                          tr_file_index_t     file );
    1184 
    11851171/** @brief Set a batch of files to be downloaded or not. */
    11861172void tr_torrentSetFileDLs( tr_torrent       * torrent,
  • trunk/macosx/Torrent.m

    r10131 r10174  
    13411341    for (NSUInteger index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
    13421342    {
    1343         if (tr_torrentGetFileDL(fHandle, index) || ![self canChangeDownloadCheckForFile: index])
     1343        if ( !fInfo->files[index].dnd || ![self canChangeDownloadCheckForFile: index])
    13441344            onState = YES;
    13451345        else
     
    13801380{
    13811381    for (NSUInteger index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
    1382         if (priority == tr_torrentGetFilePriority(fHandle, index) && [self canChangeDownloadCheckForFile: index])
     1382        if ((priority == fInfo->files[index].priority) && [self canChangeDownloadCheckForFile: index])
    13831383            return YES;
    13841384    return NO;
     
    13951395            continue;
    13961396       
    1397         const tr_priority_t priority = tr_torrentGetFilePriority(fHandle, index);
     1397        const tr_priority_t priority = fInfo->files[index].priority;
    13981398        if (priority == TR_PRI_LOW)
    13991399        {
Note: See TracChangeset for help on using the changeset viewer.