Changeset 10873


Ignore:
Timestamp:
Jun 26, 2010, 5:48:57 PM (13 years ago)
Author:
Longinus00
Message:

(2.0x qt) #3286:Use flagStr in the status field of the peer list

Location:
branches/2.0x
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0x/doc/rpc-spec.txt

    r10638 r10873  
    217217                      | clientIsChoked          | boolean    | tr_peer_stat
    218218                      | clientIsInterested      | boolean    | tr_peer_stat
     219                      | flagStr                 | string     | tr_peer_stat
    219220                      | isDownloadingFrom       | boolean    | tr_peer_stat
    220221                      | isEncrypted             | boolean    | tr_peer_stat
  • branches/2.0x/qt/details.cc

    r10867 r10873  
    824824            }
    825825
    826             QString code;
    827             if( peer.isDownloadingFrom )                           { code += 'D'; }
    828             else if( peer.clientIsInterested )                     { code += 'd'; }
    829             if( peer.isUploadingTo )                               { code += 'U'; }
    830             else if( peer.peerIsInterested )                       { code += 'u'; }
    831             if( !peer.clientIsChoked && !peer.clientIsInterested ) { code += 'K'; }
    832             if( !peer.peerIsChoked && !peer.peerIsInterested )     { code += '?'; }
    833             if( peer.isEncrypted )                                 { code += 'E'; }
    834             if( peer.isIncoming )                                  { code += 'I'; }
     826            const QString code = peer.flagStr;
    835827            item->setStatus( code );
    836828            item->refresh( peer );
     
    848840                    case '?': txt = tr( "We unchoked this peer, but they're not interested" ); break;
    849841                    case 'E': txt = tr( "Encrypted connection" ); break;
     842                    case 'H': txt = tr( "Peer was discovered through DHT" ); break;
    850843                    case 'X': txt = tr( "Peer was discovered through Peer Exchange (PEX)" ); break;
    851844                    case 'I': txt = tr( "Peer is an incoming connection" ); break;
  • branches/2.0x/qt/torrent.cc

    r10772 r10873  
    636636            if( tr_bencDictFindBool( child, "clientIsInterested", &b ) )
    637637                peer.clientIsInterested = b;
     638            if( tr_bencDictFindStr( child, "flagStr", &str ) )
     639                peer.flagStr = QString::fromUtf8( str );
    638640            if( tr_bencDictFindBool( child, "isDownloadingFrom", &b ) )
    639641                peer.isDownloadingFrom = b;
  • branches/2.0x/qt/torrent.h

    r10771 r10873  
    4343    bool clientIsChoked;
    4444    bool clientIsInterested;
     45    QString flagStr;
    4546    bool isDownloadingFrom;
    4647    bool isEncrypted;
Note: See TracChangeset for help on using the changeset viewer.