Changeset 7707


Ignore:
Timestamp:
Jan 13, 2009, 4:39:19 PM (12 years ago)
Author:
charles
Message:

(trunk libT) Remove tr_torrentNext() from the public libT API (wereHamster)

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/main.c

    r7658 r7707  
    238238
    239239    {
    240         tr_torrent * tor = NULL;
    241240        tr_session * session = tr_core_session( data->core );
    242         int activeCount = 0;
    243         while(( tor = tr_torrentNext( session, tor )))
    244             if( TR_STATUS_IS_ACTIVE( tr_torrentGetActivity( tor )))
    245                 ++activeCount;
     241        int activeCount = tr_sessionGetActiveTorrentCount( session );
    246242        action_sensitize( "pause-all-torrents", activeCount != 0 );
    247243    }
  • trunk/gtk/notify.c

    r7691 r7707  
    1616#endif
    1717#include <glib/gi18n.h>
     18#include "conf.h"
    1819#include "notify.h"
    1920#include "tr-prefs.h"
  • trunk/gtk/tr-core.c

    r7464 r7707  
    12081208    /* always allow hibernation when all the torrents are paused */
    12091209    if( inhibit ) {
    1210         gboolean active = FALSE;
    1211         tr_session *  session = tr_core_session( core );
    1212         tr_torrent * tor = NULL;
    1213         while(( tor = tr_torrentNext( session, tor )))
    1214             if(( active = ( tr_torrentGetActivity( tor ) != TR_STATUS_STOPPED )))
    1215                 break;
    1216         if( !active )
     1210        tr_session * session = tr_core_session( core );
     1211
     1212        if( tr_sessionGetActiveTorrentCount( session ) == 0 )
    12171213            inhibit = FALSE;
    12181214    }
  • trunk/libtransmission/session.c

    r7706 r7707  
    14001400}
    14011401
     1402int
     1403tr_sessionGetActiveTorrentCount( tr_session * session )
     1404{
     1405    int ret;
     1406    tr_torrent * tor;
     1407
     1408    while(( tor = tr_torrentNext( session, tor )))
     1409        if( tr_torrentGetActivity( tor ) != TR_STATUS_STOPPED )
     1410            ++ret;
     1411   
     1412    return ret;
     1413}
  • trunk/libtransmission/torrent.h

    r7663 r7707  
    112112                                      size_t            * setmeCount );
    113113
     114tr_torrent*      tr_torrentNext( tr_session  * session,
     115                                 tr_torrent  * current );
     116
     117
    114118typedef enum
    115119{
  • trunk/libtransmission/transmission.h

    r7663 r7707  
    564564                                      int         * setmeCount );
    565565
     566int tr_sessionGetActiveTorrentCount( tr_session * session );
     567
    566568/** @} */
    567569
     
    817819 */
    818820void tr_torrentDeleteLocalData( tr_torrent * torrent,  tr_fileFunc fileFunc );
    819 
    820 /**
    821  * @brief Iterate through the torrents.
    822  *
    823  * Pass in a NULL pointer to get the first torrent.
    824  */
    825 tr_torrent* tr_torrentNext( tr_session  * session,
    826                             tr_torrent  * current );
    827 
    828821
    829822uint64_t tr_torrentGetBytesLeftToAllocate( const tr_torrent * torrent );
Note: See TracChangeset for help on using the changeset viewer.