| 561 | |
| 562 | |
| 563 | CPartFile* CDownloadQueue::GetFileByID(const CMD4Hash& filehash) const |
| 564 | { |
| 565 | wxMutexLocker lock( m_mutex ); |
| 566 | |
| 567 | for ( FileQueue::size_type i = 0; i < m_filelist.size(); ++i ) { |
| 568 | if ( filehash == m_filelist[i]->GetFileHash()) { |
| 569 | return m_filelist[ i ]; |
| 570 | } |
| 571 | } |
| 572 | // Check completed too so we can execute remote commands (like change cat) on them |
| 573 | for (FileList::const_iterator it = m_completedDownloads.begin(); it != m_completedDownloads.end(); ++it) { |
| 574 | if ( filehash == (*it)->GetFileHash()) { |
| 575 | return *it; |
| 576 | } |
| 577 | } |
| 578 | |
| 579 | return NULL; |
| 580 | } |
| 581 | |
| 582 | |
| 583 | CPartFile* CDownloadQueue::GetFileByIndex(unsigned int index) const |
no test coverage detected