| 306 | } |
| 307 | |
| 308 | void CSearchFile::SetDownloadStatus() |
| 309 | { |
| 310 | bool isPart = theApp->downloadqueue->GetFileByID(m_abyFileHash) != NULL; |
| 311 | bool isKnown = theApp->knownfiles->FindKnownFileByID(m_abyFileHash) != NULL; |
| 312 | bool isCanceled = theApp->canceledfiles->IsCanceledFile(m_abyFileHash); |
| 313 | |
| 314 | if (isCanceled && isPart) { |
| 315 | m_downloadStatus = QUEUEDCANCELED; |
| 316 | } else if (isCanceled) { |
| 317 | m_downloadStatus = CANCELED; |
| 318 | } else if (isPart) { |
| 319 | m_downloadStatus = QUEUED; |
| 320 | } else if (isKnown) { |
| 321 | m_downloadStatus = DOWNLOADED; |
| 322 | } else { |
| 323 | m_downloadStatus = NEW; |
| 324 | } |
| 325 | // Update status of children too |
| 326 | for (CSearchResultList::iterator it = m_children.begin(); it != m_children.end(); ++it) { |
| 327 | Notify_Search_Update_Sources(*it); |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | // File_checked_for_headers |
no test coverage detected