| 633 | } |
| 634 | |
| 635 | void BackgroundParser::revertAllRequests(QObject* notifyWhenReady) |
| 636 | { |
| 637 | Q_ASSERT(notifyWhenReady != nullptr); |
| 638 | Q_D(BackgroundParser); |
| 639 | |
| 640 | QMutexLocker lock(&d->m_mutex); |
| 641 | for (auto it = d->m_documents.begin(); it != d->m_documents.end();) { |
| 642 | d->m_documentsForPriority[it.value().priority()].remove(it.key()); |
| 643 | |
| 644 | it->removeTargetsForListener(notifyWhenReady); |
| 645 | |
| 646 | if ((*it).targets().isEmpty()) { |
| 647 | it = d->m_documents.erase(it); |
| 648 | --d->m_maxParseJobs; |
| 649 | |
| 650 | continue; |
| 651 | } |
| 652 | |
| 653 | d->m_documentsForPriority[it.value().priority()].insert(it.key()); |
| 654 | ++it; |
| 655 | } |
| 656 | } |
| 657 | |
| 658 | bool BackgroundParser::addListenerToDocumentIfExist(const IndexedString& url, TopDUContext::Features features, int priority, |
| 659 | QObject* notifyWhenReady, ParseJob::SequentialProcessingFlags flags, |