Changeset 2085
- Timestamp:
- Jun 16, 2007, 12:19:55 AM (15 years ago)
- Location:
- branches/file_selection
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/file_selection/libtransmission/internal.h
r2082 r2085 176 176 int error; 177 177 char errorString[128]; 178 int finished;178 int hasChangedState; 179 179 180 180 char * id; -
branches/file_selection/libtransmission/torrent.c
r2084 r2085 173 173 tor->key = h->key; 174 174 tor->azId = h->azId; 175 tor-> finished = 0;175 tor->hasChangedState = -1; 176 176 177 177 /* Escaped info hash for HTTP queries */ … … 378 378 } 379 379 380 int tr_getFinished( tr_torrent_t * tor ) 381 { 382 if( tor->finished ) 383 { 384 tor->finished = 0; 380 int 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 390 int 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 400 int tr_getComplete( tr_torrent_t * tor ) 401 { 402 if( tor->hasChangedState == TR_CP_COMPLETE ) 403 { 404 tor->hasChangedState = -1; 385 405 return 1; 386 406 } … … 969 989 } 970 990 971 tor-> finished = cpState != TR_CP_INCOMPLETE;991 tor->hasChangedState = cpState; 972 992 973 993 if( cpState == TR_CP_COMPLETE ) -
branches/file_selection/libtransmission/transmission.h
r2082 r2085 339 339 340 340 /*********************************************************************** 341 * tr_get Finished342 *********************************************************************** 343 * The first call after a torrent is completedreturns 1. Returns 0341 * tr_getComplete, tr_getIncomplete and tr_getPartial 342 *********************************************************************** 343 * The first call after a torrent changed state returns 1. Returns 0 344 344 * in other cases. 345 345 **********************************************************************/ 346 int tr_getFinished( tr_torrent_t * ); 346 int tr_getIncomplete( tr_torrent_t * tor ); 347 int tr_getDone( tr_torrent_t * tor ); 348 int tr_getComplete( tr_torrent_t * tor ); 347 349 348 350 -
branches/file_selection/macosx/Torrent.m
r2080 r2085 306 306 307 307 //notification when downloading finished 308 if (tr_get Finished(fHandle))308 if (tr_getComplete(fHandle) || tr_getDone(fHandle)) 309 309 { 310 310 BOOL canMove = YES;
Note: See TracChangeset
for help on using the changeset viewer.