Changeset 2085


Ignore:
Timestamp:
Jun 16, 2007, 12:19:55 AM (15 years ago)
Author:
livings124
Message:

patch from Waldorf to further differentiate the justFinished ability

Location:
branches/file_selection
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/file_selection/libtransmission/internal.h

    r2082 r2085  
    176176    int               error;
    177177    char              errorString[128];
    178     int               finished;
     178    int               hasChangedState;
    179179
    180180    char            * id;
  • branches/file_selection/libtransmission/torrent.c

    r2084 r2085  
    173173    tor->key      = h->key;
    174174    tor->azId     = h->azId;
    175     tor->finished = 0;
     175    tor->hasChangedState = -1;
    176176
    177177    /* Escaped info hash for HTTP queries */
     
    378378}
    379379
    380 int tr_getFinished( tr_torrent_t * tor )
    381 {
    382     if( tor->finished )
    383     {
    384         tor->finished = 0;
     380int tr_getIncomplete( tr_torrent_t * tor )
     381{
     382    if( tor->hasChangedState == TR_CP_INCOMPLETE )
     383    {
     384        tor->hasChangedState = -1;
     385        return 1;
     386    }
     387    return 0;
     388}
     389
     390int tr_getDone( tr_torrent_t * tor )
     391{
     392    if( tor->hasChangedState == TR_CP_DONE )
     393    {
     394        tor->hasChangedState = -1;
     395        return 1;
     396    }
     397    return 0;
     398}
     399
     400int tr_getComplete( tr_torrent_t * tor )
     401{
     402    if( tor->hasChangedState == TR_CP_COMPLETE )
     403    {
     404        tor->hasChangedState = -1;
    385405        return 1;
    386406    }
     
    969989            }
    970990
    971             tor->finished = cpState != TR_CP_INCOMPLETE;
     991            tor->hasChangedState = cpState;
    972992
    973993            if( cpState == TR_CP_COMPLETE )
  • branches/file_selection/libtransmission/transmission.h

    r2082 r2085  
    339339
    340340/***********************************************************************
    341  * tr_getFinished
    342  ***********************************************************************
    343  * The first call after a torrent is completed returns 1. Returns 0
     341 * tr_getComplete, tr_getIncomplete and tr_getPartial
     342 ***********************************************************************
     343 * The first call after a torrent changed state returns 1. Returns 0
    344344 * in other cases.
    345345 **********************************************************************/
    346 int tr_getFinished( tr_torrent_t * );
     346int tr_getIncomplete( tr_torrent_t * tor );
     347int tr_getDone( tr_torrent_t * tor );
     348int tr_getComplete( tr_torrent_t * tor );
    347349
    348350
  • branches/file_selection/macosx/Torrent.m

    r2080 r2085  
    306306   
    307307    //notification when downloading finished
    308     if (tr_getFinished(fHandle))
     308    if (tr_getComplete(fHandle) || tr_getDone(fHandle))
    309309    {
    310310        BOOL canMove = YES;
Note: See TracChangeset for help on using the changeset viewer.