]> granicus.if.org Git - transmission/commitdiff
(trunk gtk) #3838 "Unselected active torrents not counted for quit check" -- fixed.
authorCharles Kerr <charles@transmissionbt.com>
Sun, 19 Dec 2010 09:33:02 +0000 (09:33 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Sun, 19 Dec 2010 09:33:02 +0000 (09:33 +0000)
gtk/main.c
gtk/tr-core.c
gtk/tr-core.h

index eb99b6d37a3c6175d1819cfd65c51dbefd5c2207..a2d9b26778e7ed7681b9a84b9a9b7ce7a8677938 100644 (file)
@@ -339,8 +339,8 @@ refreshActions( gpointer gdata )
     }
 
     {
-        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 );
     }
@@ -964,13 +964,8 @@ toggleMainWindow( struct cbdata * cbdata )
 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
index 90838b6da5e29a269e08cb95ad2f43bdf5ac7b4d..008b0164494a090968fe5c74610d5b004993456b 100644 (file)
@@ -1761,18 +1761,18 @@ tr_core_torrent_changed( TrCore * core, int id )
     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
     {
index 880c70fdefce326540e886de8c2bb1f5832ceb29..08244d4df19e5a8d58a81e669e09d0d9e3de79a3 100644 (file)
@@ -83,9 +83,9 @@ GtkTreeModel * tr_core_model( TrCore * self );
 
 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 );
 
 /******
 *******