}
{
- const int total = tr_core_get_torrent_count( data->core );
- const int active = tr_core_get_active_torrent_count( data->core );
+ const size_t total = tr_core_get_torrent_count( data->core );
+ const size_t active = tr_core_get_active_torrent_count( data->core );
action_sensitize( "pause-all-torrents", active != 0 );
action_sensitize( "start-all-torrents", active != total );
}
static gboolean
shouldConfirmBeforeExiting( struct cbdata * data )
{
- if( !pref_flag_get( PREF_KEY_ASKQUIT ) )
- return FALSE;
- else {
- struct counts_data counts;
- getTorrentCounts( data, &counts );
- return counts.activeCount > 0;
- }
+ return pref_flag_get( PREF_KEY_ASKQUIT )
+ && tr_core_get_active_torrent_count( data->core );
}
static void
while( gtk_tree_model_iter_next( model, &iter ) );
}
-int
+size_t
tr_core_get_torrent_count( TrCore * core )
{
return gtk_tree_model_iter_n_children( tr_core_model( core ), NULL );
}
-int
+size_t
tr_core_get_active_torrent_count( TrCore * core )
{
GtkTreeIter iter;
GtkTreeModel * model = tr_core_model( core );
- int activeCount = 0;
+ size_t activeCount = 0;
if( gtk_tree_model_get_iter_first( model, &iter ) ) do
{
tr_session * tr_core_session( TrCore * self );
-int tr_core_get_active_torrent_count( TrCore * self );
+size_t tr_core_get_active_torrent_count( TrCore * self );
-int tr_core_get_torrent_count( TrCore * self );
+size_t tr_core_get_torrent_count( TrCore * self );
/******
*******