| 410 | |
| 411 | |
| 412 | uint32 CSearchList::GetSearchProgress() const |
| 413 | { |
| 414 | if (m_searchType == KadSearch) { |
| 415 | // We cannot measure the progress of Kad searches. |
| 416 | // But we can tell when they are over. |
| 417 | return m_KadSearchFinished ? 0xfffe : 0; |
| 418 | } |
| 419 | if (m_searchInProgress == false) { // true only for ED2K search |
| 420 | // No search, no progress ;) |
| 421 | return 0; |
| 422 | } |
| 423 | |
| 424 | switch (m_searchType) { |
| 425 | case LocalSearch: |
| 426 | return 0xffff; |
| 427 | |
| 428 | case GlobalSearch: |
| 429 | return 100 - (m_serverQueue.GetRemaining() * 100) |
| 430 | / theApp->serverlist->GetServerCount(); |
| 431 | |
| 432 | default: |
| 433 | wxFAIL; |
| 434 | } |
| 435 | return 0; |
| 436 | } |
| 437 | |
| 438 | |
| 439 | void CSearchList::OnGlobalSearchTimer(CTimerEvent& WXUNUSED(evt)) |
no test coverage detected