File indexing completed on 2025-01-05 04:37:17
0001 /* 0002 SPDX-FileCopyrightText: 2005 Joris Guisson <joris.guisson@gmail.com> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 #include "peersource.h" 0007 0008 namespace bt 0009 { 0010 PeerSource::PeerSource() 0011 { 0012 } 0013 0014 PeerSource::~PeerSource() 0015 { 0016 } 0017 0018 void PeerSource::completed() 0019 { 0020 } 0021 0022 void PeerSource::manualUpdate() 0023 { 0024 } 0025 0026 void PeerSource::aboutToBeDestroyed() 0027 { 0028 } 0029 0030 void PeerSource::addPeer(const net::Address &addr, bool local) 0031 { 0032 peers.append(qMakePair(addr, local)); 0033 } 0034 0035 bool PeerSource::takePeer(net::Address &addr, bool &local) 0036 { 0037 if (peers.count() > 0) { 0038 addr = peers.front().first; 0039 local = peers.front().second; 0040 peers.pop_front(); 0041 return true; 0042 } 0043 return false; 0044 } 0045 0046 } 0047 0048 #include "moc_peersource.cpp"