Changeset 11546


Ignore:
Timestamp:
Dec 19, 2010, 9:33:02 AM (12 years ago)
Author:
charles
Message:

(trunk gtk) #3838 "Unselected active torrents not counted for quit check" -- fixed.

Location:
trunk/gtk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/main.c

    r11521 r11546  
    340340
    341341    {
    342         const int total = tr_core_get_torrent_count( data->core );
    343         const int active = tr_core_get_active_torrent_count( data->core );
     342        const size_t total = tr_core_get_torrent_count( data->core );
     343        const size_t active = tr_core_get_active_torrent_count( data->core );
    344344        action_sensitize( "pause-all-torrents", active != 0 );
    345345        action_sensitize( "start-all-torrents", active != total );
     
    965965shouldConfirmBeforeExiting( struct cbdata * data )
    966966{
    967     if( !pref_flag_get( PREF_KEY_ASKQUIT ) )
    968         return FALSE;
    969     else {
    970         struct counts_data counts;
    971         getTorrentCounts( data, &counts );
    972         return counts.activeCount > 0;
    973     }
     967    return pref_flag_get( PREF_KEY_ASKQUIT )
     968        && tr_core_get_active_torrent_count( data->core );
    974969}
    975970
  • trunk/gtk/tr-core.c

    r11538 r11546  
    17621762}
    17631763
    1764 int
     1764size_t
    17651765tr_core_get_torrent_count( TrCore * core )
    17661766{
     
    17681768}
    17691769
    1770 int
     1770size_t
    17711771tr_core_get_active_torrent_count( TrCore * core )
    17721772{
    17731773    GtkTreeIter iter;
    17741774    GtkTreeModel * model = tr_core_model( core );
    1775     int activeCount = 0;
     1775    size_t activeCount = 0;
    17761776
    17771777    if( gtk_tree_model_get_iter_first( model, &iter ) ) do
  • trunk/gtk/tr-core.h

    r11114 r11546  
    8484tr_session *   tr_core_session( TrCore * self );
    8585
    86 int            tr_core_get_active_torrent_count( TrCore * self );
    87 
    88 int            tr_core_get_torrent_count( TrCore * self );
     86size_t         tr_core_get_active_torrent_count( TrCore * self );
     87
     88size_t         tr_core_get_torrent_count( TrCore * self );
    8989
    9090/******
Note: See TracChangeset for help on using the changeset viewer.