Changeset 5218
- Timestamp:
- Mar 7, 2008, 7:05:00 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gtk/dialogs.c
r5216 r5218 293 293 GList * torrents; 294 294 TrCore * core; 295 int busyCount;296 295 }; 297 296 … … 321 320 322 321 static void 323 tabulateTorrents( gpointer gtor, gpointer gdata ) 324 { 325 struct DeleteData * data = gdata; 322 countBusyTorrents( gpointer gtor, gpointer busyCount ) 323 { 326 324 const tr_stat * stat = tr_torrent_stat( gtor ); 327 325 328 326 if( stat->leftUntilDone || stat->peersConnected ) 329 ++ data->busyCount;327 ++(*(int*)busyCount); 330 328 } 331 329 … … 338 336 GtkWidget * d; 339 337 struct DeleteData * dd; 338 int busyCount; 340 339 const int count = g_list_length( torrents ); 341 340 const char * primary_text; … … 350 349 dd->delete_files = delete_files; 351 350 352 g_list_foreach( torrents, tabulateTorrents, dd ); 353 354 if( !dd->busyCount && !delete_files ) /* don't prompt boring torrents */ 351 busyCount = 0; 352 g_list_foreach( torrents, countBusyTorrents, &busyCount ); 353 354 if( !busyCount && !delete_files ) /* don't prompt boring torrents */ 355 355 { 356 356 removeTorrents( dd ); … … 366 366 count ); 367 367 368 if( dd->busyCount > 1 )368 if( busyCount > 1 ) 369 369 secondary_text = _( "Some of these torrents are incomplete or connected to peers." ); 370 else if( dd->busyCount == 0 )370 else if( busyCount == 0 ) 371 371 secondary_text = NULL; 372 372 else
Note: See TracChangeset
for help on using the changeset viewer.