Changeset 10872


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

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

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/rpc-spec.txt

    r10798 r10872  
    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
  • trunk/qt/details.cc

    r10836 r10872  
    826826            }
    827827
    828             QString code;
    829             if( peer.isDownloadingFrom )                           { code += 'D'; }
    830             else if( peer.clientIsInterested )                     { code += 'd'; }
    831             if( peer.isUploadingTo )                               { code += 'U'; }
    832             else if( peer.peerIsInterested )                       { code += 'u'; }
    833             if( !peer.clientIsChoked && !peer.clientIsInterested ) { code += 'K'; }
    834             if( !peer.peerIsChoked && !peer.peerIsInterested )     { code += '?'; }
    835             if( peer.isEncrypted )                                 { code += 'E'; }
    836             if( peer.isIncoming )                                  { code += 'I'; }
     828            const QString code = peer.flagStr;
    837829            item->setStatus( code );
    838830            item->refresh( peer );
     
    850842                    case '?': txt = tr( "We unchoked this peer, but they're not interested" ); break;
    851843                    case 'E': txt = tr( "Encrypted connection" ); break;
     844                    case 'H': txt = tr( "Peer was discovered through DHT" ); break;
    852845                    case 'X': txt = tr( "Peer was discovered through Peer Exchange (PEX)" ); break;
    853846                    case 'I': txt = tr( "Peer is an incoming connection" ); break;
  • trunk/qt/torrent.cc

    r10772 r10872  
    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;
  • trunk/qt/torrent.h

    r10771 r10872  
    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.