Changeset 4367


Ignore:
Timestamp:
Dec 28, 2007, 6:22:40 AM (15 years ago)
Author:
charles
Message:

(gtk) reduce the load a little bit more when all the rows are selected.

Location:
trunk/gtk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/main.c

    r4363 r4367  
    160160
    161161static void
    162 accumulateStatusForeach (GtkTreeModel * model,
     162accumulateStatusForeach( GtkTreeModel * model,
    163163                         GtkTreePath  * path UNUSED,
    164164                         GtkTreeIter  * iter,
     
    167167    int status = 0;
    168168    struct counts_data * counts = user_data;
    169     tr_torrent * tor;
    170169
    171170    ++counts->totalCount;
    172171
    173     gtk_tree_model_get( model, iter, MC_TORRENT_RAW, &tor, -1 );
    174     status = tr_torrentStat( tor )->status;
     172    gtk_tree_model_get( model, iter, MC_STATUS, &status, -1 );
    175173
    176174    if( TR_STATUS_IS_ACTIVE( status ) )
     
    186184                            gpointer       accumulated_status)
    187185{
    188     TrTorrent * gtor = NULL;
    189     gtk_tree_model_get( model, iter, MC_TORRENT, &gtor, -1 );
    190     *(int*)accumulated_status |=
    191         tr_torrentCanManualUpdate( tr_torrent_handle( gtor ) );
    192     g_object_unref( G_OBJECT( gtor ) );
     186    tr_torrent * tor;
     187    gtk_tree_model_get( model, iter, MC_TORRENT_RAW, &tor, -1 );
     188    *(int*)accumulated_status |= tr_torrentCanManualUpdate( tor );
    193189}
    194190
  • trunk/gtk/tr_core.c

    r4365 r4367  
    255255                gpointer         user_data UNUSED )
    256256{
    257     tr_torrent *ta, *tb;
    258     gtk_tree_model_get( model, a, MC_TORRENT_RAW, &ta, -1 );
    259     gtk_tree_model_get( model, b, MC_TORRENT_RAW, &tb, -1 );
    260     return tr_torrentStatCached(ta)->status - tr_torrentStatCached(tb)->status;
     257    int sa, sb;
     258    gtk_tree_model_get( model, a, MC_STATUS, &sa, -1 );
     259    gtk_tree_model_get( model, b, MC_STATUS, &sb, -1 );
     260    return sa - sb;
    261261}
    262262
     
    655655                                     -1 );
    656656
    657     torStat = tr_torrentStat( tr_torrent_handle( gtor ) );
     657    torStat = tr_torrent_stat( gtor );
    658658
    659659    if( oldStatus != (int) torStat->status )
Note: See TracChangeset for help on using the changeset viewer.