Changeset 4354


Ignore:
Timestamp:
Dec 27, 2007, 6:56:54 PM (14 years ago)
Author:
charles
Message:

safer version of r4348

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr_core.c

    r4348 r4354  
    186186{
    187187    int i;
     188    tr_torrent *ta, *tb;
    188189    const tr_stat *sa, *sb;
    189     gtk_tree_model_get( model, a, MC_STAT, &sa, -1 );
    190     gtk_tree_model_get( model, b, MC_STAT, &sb, -1 );
     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 );
    191196
    192197    if(( i = compareDouble( sa->rateUpload + sa->rateDownload,
     
    232237{
    233238    int ret;
     239    tr_torrent *ta, *tb;
    234240    const tr_stat *sa, *sb;
    235     gtk_tree_model_get( model, a, MC_STAT, &sa, -1 );
    236     gtk_tree_model_get( model, b, MC_STAT, &sb, -1 );
     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 );
    237245    ret = compareDouble( sa->percentDone, sb->percentDone );
    238246    if( !ret )
     
    247255                gpointer         user_data UNUSED )
    248256{
    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;
     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;
    253261}
    254262
Note: See TracChangeset for help on using the changeset viewer.