Changeset 3147


Ignore:
Timestamp:
Sep 23, 2007, 1:53:44 PM (15 years ago)
Author:
charles
Message:
  • when a torrent's done downloading, have it switch to seeding mode.
  • tweak the gtk+ client's torrent inspector's display of transfer rates
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/torrent-inspector.c

    r3111 r3147  
    378378                gpointer             data UNUSED)
    379379{
    380   char * pch;
    381380  float rate = 0.0;
    382381  gtk_tree_model_get (tree_model, iter, PEER_COL_UPLOAD_RATE, &rate, -1);
    383   pch = readablespeed (rate);
    384   g_object_set (renderer, "text", pch, NULL);
    385   g_free (pch);
     382  if( rate < 0.01 )
     383    g_object_set (renderer, "text", "", NULL);
     384  else {
     385    char * pch = readablespeed (rate);
     386    g_object_set (renderer, "text", pch, NULL);
     387    g_free (pch);
     388  }
    386389}
    387390
     
    393396                gpointer             data UNUSED)
    394397{
    395   char * pch;
    396398  float rate = 0.0;
    397399  gtk_tree_model_get (tree_model, iter, PEER_COL_DOWNLOAD_RATE, &rate, -1);
    398   pch = readablespeed (rate);
    399   g_object_set (renderer, "text", pch, NULL);
    400   g_free (pch);
     400  if( rate < 0.01 )
     401    g_object_set (renderer, "text", "", NULL);
     402  else {
     403    char * pch = readablespeed (rate);
     404    g_object_set (renderer, "text", pch, NULL);
     405    g_free (pch);
     406  }
    401407}
    402408
  • trunk/libtransmission/internal.h

    r3122 r3147  
    4545#define FALSE 0
    4646#endif
     47
     48
     49void tr_torrentRecheckCompleteness( tr_torrent * );
    4750
    4851int tr_trackerInfoInit( struct tr_tracker_info  * info,
  • trunk/libtransmission/peer-mgr.c

    r3144 r3147  
    633633        case TR_PEERMSG_CLIENT_HAVE:
    634634            broadcastClientHave( t, e->pieceIndex );
     635            tr_torrentRecheckCompleteness( t->tor );
    635636            break;
    636637
     
    700701        return;
    701702    }
    702 
    703     fprintf( stderr, "peer-mgr: torrent [%s] finished a handshake. Connected? %s.\n", t->tor->info.name, (isConnected?"yes":"no") );
    704703
    705704    /* if we couldn't connect or were snubbed,
  • trunk/libtransmission/torrent.c

    r3127 r3147  
    254254}
    255255
    256 static void recheckCpState( tr_torrent * );
    257 
    258256static void
    259257tr_torrentStartImpl( tr_torrent * tor )
     
    264262    *tor->errorString = '\0';
    265263    tr_torrentResetTransferStats( tor );
    266     recheckCpState( tor );
     264    tr_torrentRecheckCompleteness( tor );
    267265    tor->startDate = tr_date();
    268266    tr_trackerStart( tor->tracker );
     
    273271recheckDoneCB( tr_torrent * tor )
    274272{
    275     recheckCpState( tor );
     273    tr_torrentRecheckCompleteness( tor );
    276274
    277275    if( tor->doStopAfterHashCheck ) {
     
    636634
    637635    tr_fastResumeSave( tor );
    638     recheckCpState( tor );
     636    tr_torrentRecheckCompleteness( tor );
    639637
    640638    tr_timerFree( &tor->saveTimer );
     
    10971095}
    10981096
    1099 static void
    1100 recheckCpState( tr_torrent * tor )
     1097void
     1098tr_torrentRecheckCompleteness( tr_torrent * tor )
    11011099{
    11021100    cp_status_t cpStatus;
Note: See TracChangeset for help on using the changeset viewer.