Changeset 4348


Ignore:
Timestamp:
Dec 27, 2007, 6:59:48 AM (14 years ago)
Author:
charles
Message:

(gtk) fix trunk refresh bug reported by hussam in irc.

Location:
trunk/gtk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr_core.c

    r4314 r4348  
    186186{
    187187    int i;
    188     tr_torrent *ta, *tb;
    189188    const tr_stat *sa, *sb;
    190 
    191     gtk_tree_model_get( model, a, MC_TORRENT_RAW, &ta, -1 );
    192     gtk_tree_model_get( model, b, MC_TORRENT_RAW, &tb, -1 );
    193 
    194     sa = tr_torrentStatCached( ta );
    195     sb = tr_torrentStatCached( tb );
     189    gtk_tree_model_get( model, a, MC_STAT, &sa, -1 );
     190    gtk_tree_model_get( model, b, MC_STAT, &sb, -1 );
    196191
    197192    if(( i = compareDouble( sa->rateUpload + sa->rateDownload,
     
    237232{
    238233    int ret;
    239     tr_torrent *ta, *tb;
    240234    const tr_stat *sa, *sb;
    241     gtk_tree_model_get( model, a, MC_TORRENT_RAW, &ta, -1 );
    242     gtk_tree_model_get( model, b, MC_TORRENT_RAW, &tb, -1 );
    243     sa = tr_torrentStatCached( ta );
    244     sb = tr_torrentStatCached( tb );
     235    gtk_tree_model_get( model, a, MC_STAT, &sa, -1 );
     236    gtk_tree_model_get( model, b, MC_STAT, &sb, -1 );
    245237    ret = compareDouble( sa->percentDone, sb->percentDone );
    246238    if( !ret )
     
    255247                gpointer         user_data UNUSED )
    256248{
    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;
     249    const tr_stat *sa, *sb;
     250    gtk_tree_model_get( model, a, MC_STAT, &sa, -1 );
     251    gtk_tree_model_get( model, b, MC_STAT, &sb, -1 );
     252    return sa->status - sb->status;
    261253}
    262254
     
    336328        TR_TORRENT_TYPE,  /* TrTorrent object */
    337329        G_TYPE_POINTER,   /* tr_torrent* */
     330        G_TYPE_POINTER,   /* tr_stat* */
    338331        G_TYPE_INT        /* ID for IPC */
    339332    };
     
    645638                gpointer       data UNUSED)
    646639{
    647     TrTorrent * tor;
    648 
    649     gtk_tree_model_get( model, iter, MC_TORRENT, &tor, -1 );
    650     tr_torrent_check_seeding_cap ( tor );
    651     g_object_unref( tor );
    652 
     640    TrTorrent * gtor;
     641    const tr_stat * torStat;
     642    gtk_tree_model_get( model, iter, MC_TORRENT, &gtor, -1 );
     643
     644    torStat = tr_torrentStat( tr_torrent_handle( gtor ) );
     645    gtk_list_store_set( GTK_LIST_STORE( model ), iter,
     646                        MC_STAT, (gpointer)torStat,
     647                        -1 );
     648    tr_torrent_check_seeding_cap ( gtor );
     649
     650    g_object_unref( gtor );
    653651    return FALSE;
    654652}
  • trunk/gtk/tr_core.h

    r4221 r4348  
    182182    MC_TORRENT,
    183183    MC_TORRENT_RAW,
     184    MC_STAT,
    184185    MC_ID,
    185186    MC_ROW_COUNT
Note: See TracChangeset for help on using the changeset viewer.