MCPcopy Create free account
hub / github.com/amule-project/amule / GetSearchProgress

Method GetSearchProgress

src/SearchList.cpp:412–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410
411
412uint32 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
439void CSearchList::OnGlobalSearchTimer(CTimerEvent& WXUNUSED(evt))

Callers 1

ProcessRequest2Method · 0.80

Calls 2

GetServerCountMethod · 0.80
GetRemainingMethod · 0.45

Tested by

no test coverage detected