]> granicus.if.org Git - transmission/commitdiff
(trunk gtk) #3970 "tr_core_update() wastes CPU cycles by toggling the sort mode"...
authorJordan Lee <jordan@transmissionbt.com>
Tue, 1 Feb 2011 01:45:41 +0000 (01:45 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Tue, 1 Feb 2011 01:45:41 +0000 (01:45 +0000)
Clearing the model on shutdown generated a warning because it used the wrong cast. Rather than fixing the cast, add tr_core_clear() for symmetry with tr_core_load().

gtk/main.c
gtk/tr-core.c
gtk/tr-core.h

index 5b64f1b739896153758c871129dae060be29ce79..e52e7b6a5be1fabcb875331e0fd353dc536eb7e9 100644 (file)
@@ -1200,7 +1200,7 @@ wannaquit( gpointer vdata )
     gtk_widget_grab_focus( w );
 
     /* clear the UI */
-    gtk_list_store_clear( GTK_LIST_STORE( tr_core_model( cbdata->core ) ) );
+    tr_core_clear( cbdata->core );
 
     /* ensure the window is in its previous position & size.
      * this seems to be necessary because changing the main window's
index facc5c3af5c37e64bb1572b209d83514fb7cf0c2..532c65673a8c1db4a4338cf39b9f03a27b7afc4a 100644 (file)
@@ -929,6 +929,12 @@ tr_core_load( TrCore * self, gboolean forcePaused )
     tr_ctorFree( ctor );
 }
 
+void
+tr_core_clear( TrCore * self )
+{
+    gtk_list_store_clear( GTK_LIST_STORE( tr_core_raw_model( self ) ) );
+}
+
 /***
 ****
 ***/
index e1f89f75ca5a24ddb1c87ff31fdd08a48736b939..55c56d0212ae5b1438589294294206a84754f4ba 100644 (file)
@@ -80,6 +80,8 @@ void           tr_core_close( TrCore* );
 /* Return the model used without incrementing the reference count */
 GtkTreeModel * tr_core_model( TrCore * self );
 
+void           tr_core_clear( TrCore * self );
+
 tr_session *   tr_core_session( TrCore * self );
 
 size_t         tr_core_get_active_torrent_count( TrCore * self );