Changeset 5218


Ignore:
Timestamp:
Mar 7, 2008, 7:05:00 PM (14 years ago)
Author:
charles
Message:

(gtk) minor r5216 cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/dialogs.c

    r5216 r5218  
    293293    GList * torrents;
    294294    TrCore * core;
    295     int busyCount;
    296295};
    297296
     
    321320
    322321static void
    323 tabulateTorrents( gpointer gtor, gpointer gdata )
    324 {
    325     struct DeleteData * data = gdata;
     322countBusyTorrents( gpointer gtor, gpointer busyCount )
     323{
    326324    const tr_stat * stat = tr_torrent_stat( gtor );
    327325
    328326    if( stat->leftUntilDone || stat->peersConnected )
    329         ++data->busyCount;
     327        ++(*(int*)busyCount);
    330328}
    331329
     
    338336    GtkWidget * d;
    339337    struct DeleteData * dd;
     338    int busyCount;
    340339    const int count = g_list_length( torrents );
    341340    const char * primary_text;
     
    350349    dd->delete_files = delete_files;
    351350
    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 */
    355355    {
    356356        removeTorrents( dd );
     
    366366                                 count );
    367367
    368     if( dd->busyCount > 1 )
     368    if( busyCount > 1 )
    369369        secondary_text = _( "Some of these torrents are incomplete or connected to peers." );
    370     else if( dd->busyCount == 0 )
     370    else if( busyCount == 0 )
    371371        secondary_text = NULL;
    372372    else
Note: See TracChangeset for help on using the changeset viewer.