Ignore:
Timestamp:
Aug 4, 2010, 5:35:03 PM (12 years ago)
Author:
Longinus00
Message:

(2.0x) #3185: Number on drop-down menu "Activity" - "Active" seems does not follow a change in torrent status correctly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0x/gtk/tr-core.c

    r11110 r11113  
    489489}
    490490
     491static gboolean
     492isTorrentActive( tr_torrent * tor )
     493{
     494    const tr_stat * st = tr_torrentStat( tor );
     495    return ( st->peersSendingToUs > 0 )
     496        || ( st->peersGettingFromUs > 0 )
     497        || ( st->activity == TR_STATUS_CHECK );
     498}
     499
    491500#ifdef HAVE_GIO
    492501
     
    716725                      G_TYPE_DOUBLE,    /* tr_stat.pieceUploadSpeed */
    717726                      G_TYPE_DOUBLE,    /* tr_stat.pieceDownloadSpeed */
     727                      G_TYPE_BOOLEAN,   /* filter.c:ACTIVITY_FILTER_ACTIVE */
    718728                      G_TYPE_INT,       /* tr_stat.activity */
    719729                      G_TYPE_UCHAR,     /* tr_stat.finished */
     
    864874                                       MC_SPEED_UP,      st->pieceUploadSpeed,
    865875                                       MC_SPEED_DOWN,    st->pieceDownloadSpeed,
     876                                       MC_ACTIVE,        isTorrentActive( tor ),
    866877                                       MC_ACTIVITY,      st->activity,
    867878                                       MC_FINISHED,      st->finished,
     
    12621273    double oldUpSpeed, newUpSpeed;
    12631274    double oldDownSpeed, newDownSpeed;
     1275    gboolean oldActive, newActive;
    12641276    const tr_stat * st;
    12651277    TrTorrent * gtor;
     
    12691281    gtk_tree_model_get( model, iter,
    12701282                        MC_TORRENT, &gtor,
     1283                        MC_ACTIVE, &oldActive,
    12711284                        MC_ACTIVITY, &oldActivity,
    12721285                        MC_FINISHED, &oldFinished,
     
    12801293    tor = tr_torrent_handle( gtor );
    12811294    st = tr_torrentStat( tor );
     1295    newActive = isTorrentActive( tor );
    12821296    newActivity = st->activity;
    12831297    newFinished = st->finished;
     
    12891303    /* updating the model triggers off resort/refresh,
    12901304       so don't do it unless something's actually changed... */
    1291     if( ( newActivity != oldActivity )
     1305    if( ( newActive != oldActive )
     1306        || ( newActivity  != oldActivity )
    12921307        || ( newFinished != oldFinished )
    12931308        || ( newPriority != oldPriority )
     
    12971312    {
    12981313        gtk_list_store_set( GTK_LIST_STORE( model ), iter,
     1314                            MC_ACTIVE, newActive,
    12991315                            MC_ACTIVITY, newActivity,
    13001316                            MC_FINISHED, newFinished,
Note: See TracChangeset for help on using the changeset viewer.