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

Method StartNextFile

src/DownloadQueue.cpp:317–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

315
316
317void CDownloadQueue::StartNextFile(CPartFile* oldfile)
318{
319 if ( thePrefs::StartNextFile() ) {
320 SFindBestPF visitor = { -1, NULL, thePrefs::StartNextFileAlpha() };
321
322 {
323 wxMutexLocker lock(m_mutex);
324
325 if (thePrefs::StartNextFileSame()) {
326 // Get a download in the same category
327 visitor.m_category = oldfile->GetCategory();
328
329 visitor = std::for_each(m_filelist.begin(), m_filelist.end(), visitor);
330 }
331
332 if (visitor.m_result == NULL) {
333 // Get a download, regardless of category
334 visitor.m_category = -1;
335
336 visitor = std::for_each(m_filelist.begin(), m_filelist.end(), visitor);
337 }
338
339 // Alpha doesn't need special cases
340 }
341
342 if (visitor.m_result) {
343 visitor.m_result->ResumeFile();
344 }
345 }
346}
347
348
349void CDownloadQueue::AddDownload(CPartFile* file, bool paused, uint8 category)

Callers 2

CompleteFileEndedMethod · 0.45

Calls 4

ResumeFileMethod · 0.80
GetCategoryMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected