Changeset 5750
- Timestamp:
- May 6, 2008, 1:43:24 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/add-dialog.c
r5604 r5750 206 206 gtk_label_set_mnemonic_widget( GTK_LABEL( l ), w ); 207 207 addTorrentFilters( GTK_FILE_CHOOSER( w ) ); 208 g_signal_connect( w, "selection-changed",209 G_CALLBACK( sourceChanged ), data );210 208 if( data->filename ) 211 209 if( !gtk_file_chooser_set_filename( GTK_FILE_CHOOSER( w ), data->filename ) ) 212 210 g_warning( "couldn't select '%s'", data->filename ); 211 g_signal_connect( w, "selection-changed", 212 G_CALLBACK( sourceChanged ), data ); 213 213 214 214 ++row; -
trunk/libtransmission/torrent.c
r5749 r5750 358 358 } 359 359 360 static void torrentStart( tr_torrent * tor, int reloadProgress ); 361 360 362 static void 361 363 torrentRealInit( tr_handle * h, … … 478 480 479 481 if( doStart ) 480 t r_torrentStart( tor);482 torrentStart( tor, FALSE ); 481 483 } 482 484 … … 551 553 tr_torrentSetFolder( tr_torrent * tor, const char * path ) 552 554 { 553 tr_free( tor->destination ); 554 tor->destination = tr_strdup( path ); 555 tr_torrentSaveResume( tor ); 555 if( !path || !tor->destination || strcmp( path, tor->destination ) ) 556 { 557 tr_free( tor->destination ); 558 tor->destination = tr_strdup( path ); 559 tr_torrentSaveResume( tor ); 560 } 556 561 } 557 562 … … 999 1004 } 1000 1005 1001 void1002 t r_torrentStart( tr_torrent * tor)1006 static void 1007 torrentStart( tr_torrent * tor, int reloadProgress ) 1003 1008 { 1004 1009 tr_globalLock( tor->handle ); … … 1006 1011 if( !tor->isRunning ) 1007 1012 { 1008 tr_torrentLoadResume( tor, TR_FR_PROGRESS, NULL ); 1013 if( reloadProgress ) 1014 tr_torrentLoadResume( tor, TR_FR_PROGRESS, NULL ); 1009 1015 tor->isRunning = 1; 1010 1016 tr_verifyAdd( tor, checkAndStartCB ); … … 1012 1018 1013 1019 tr_globalUnlock( tor->handle ); 1020 } 1021 1022 void 1023 tr_torrentStart( tr_torrent * tor ) 1024 { 1025 torrentStart( tor, TRUE ); 1014 1026 } 1015 1027 -
trunk/libtransmission/verify.c
r5606 r5750 57 57 } 58 58 59 static void59 static int 60 60 checkFile( tr_torrent * tor, 61 61 tr_file_index_t fileIndex, … … 63 63 { 64 64 tr_piece_index_t i; 65 int changed = FALSE; 65 66 int nofile; 66 67 struct stat sb; … … 79 80 else if( !tr_torrentIsPieceChecked( tor, i ) ) 80 81 { 82 const int wasComplete = tr_cpPieceIsComplete( tor->completion, i ); 81 83 const tr_errno err = tr_ioTestPiece( tor, i ); 82 84 … … 84 86 { 85 87 tr_torrentSetHasPiece( tor, i, TRUE ); 88 if( !wasComplete ) 89 changed = TRUE; 86 90 } 87 91 else … … 92 96 * want to lose blocks in those incomplete pieces */ 93 97 94 if( tr_cpPieceIsComplete( tor->completion, i ) )98 if( wasComplete ) { 95 99 tr_torrentSetHasPiece( tor, i, FALSE ); 100 changed = TRUE; 101 } 96 102 } 97 103 } … … 99 105 tr_torrentSetPieceChecked( tor, i, TRUE ); 100 106 } 107 108 return changed; 101 109 } 102 110 … … 106 114 for( ;; ) 107 115 { 116 int changed = 0; 108 117 tr_file_index_t i; 109 118 tr_torrent * tor; … … 128 137 tr_torinf( tor, _( "Verifying torrent" ) ); 129 138 for( i=0; i<tor->info.fileCount && !stopCurrent; ++i ) 130 ch eckFile( tor, i, &stopCurrent );139 changed |= checkFile( tor, i, &stopCurrent ); 131 140 132 141 tor->verifyState = TR_VERIFY_NONE; … … 134 143 if( !stopCurrent ) 135 144 { 136 tr_torrentSaveResume( tor ); 145 if( changed ) 146 tr_torrentSaveResume( tor ); 137 147 fireCheckDone( tor, currentNode.verify_done_cb ); 138 148 }
Note: See TracChangeset
for help on using the changeset viewer.