Changeset View
Changeset View
Standalone View
Standalone View
language/backgroundparser/backgroundparser.cpp
Show First 20 Lines • Show All 582 Lines • ▼ Show 20 Line(s) | 566 | for (auto it = d->m_documents.begin(); it != d->m_documents.end(); ) { | |||
---|---|---|---|---|---|
583 | d->m_documentsForPriority[it.value().priority()].insert(it.key()); | 583 | d->m_documentsForPriority[it.value().priority()].insert(it.key()); | ||
584 | ++it; | 584 | ++it; | ||
585 | } | 585 | } | ||
586 | } | 586 | } | ||
587 | 587 | | |||
588 | void BackgroundParser::addDocument(const IndexedString& url, TopDUContext::Features features, int priority, | 588 | void BackgroundParser::addDocument(const IndexedString& url, TopDUContext::Features features, int priority, | ||
589 | QObject* notifyWhenReady, ParseJob::SequentialProcessingFlags flags, int delay) | 589 | QObject* notifyWhenReady, ParseJob::SequentialProcessingFlags flags, int delay) | ||
590 | { | 590 | { | ||
591 | // qCDebug(LANGUAGE) << "BackgroundParser::addDocument" << url.toUrl(); | 591 | qCDebug(LANGUAGE) << "BackgroundParser::addDocument" << url.toUrl(); | ||
592 | Q_ASSERT(isValidURL(url)); | 592 | // Q_ASSERT(isValidURL(url)); | ||
mwolff: unrelated change(s) (also below) | |||||
593 | QMutexLocker lock(&d->m_mutex); | 593 | QMutexLocker lock(&d->m_mutex); | ||
594 | { | 594 | { | ||
595 | DocumentParseTarget target; | 595 | DocumentParseTarget target; | ||
596 | target.priority = priority; | 596 | target.priority = priority; | ||
597 | target.features = features; | 597 | target.features = features; | ||
598 | target.sequentialProcessingFlags = flags; | 598 | target.sequentialProcessingFlags = flags; | ||
599 | target.notifyWhenReady = QPointer<QObject>(notifyWhenReady); | 599 | target.notifyWhenReady = QPointer<QObject>(notifyWhenReady); | ||
600 | 600 | | |||
▲ Show 20 Lines • Show All 216 Lines • ▼ Show 20 Line(s) | 816 | { | |||
817 | if (url.isEmpty()) { | 817 | if (url.isEmpty()) { | ||
818 | // this happens e.g. when setting the final location of a problem that is not | 818 | // this happens e.g. when setting the final location of a problem that is not | ||
819 | // yet associated with a top ctx. | 819 | // yet associated with a top ctx. | ||
820 | return nullptr; | 820 | return nullptr; | ||
821 | } | 821 | } | ||
822 | if ( !isValidURL(url) ) { | 822 | if ( !isValidURL(url) ) { | ||
823 | qCWarning(LANGUAGE) << "Tracker requested for invalild URL:" << url.toUrl(); | 823 | qCWarning(LANGUAGE) << "Tracker requested for invalild URL:" << url.toUrl(); | ||
824 | } | 824 | } | ||
825 | Q_ASSERT(isValidURL(url)); | 825 | // Q_ASSERT(isValidURL(url)); | ||
826 | 826 | | |||
827 | QMutexLocker l(&d->m_managedMutex); | 827 | QMutexLocker l(&d->m_managedMutex); | ||
828 | return d->m_managed.value(url, nullptr); | 828 | return d->m_managed.value(url, nullptr); | ||
829 | } | 829 | } | ||
830 | 830 | | |||
831 | void BackgroundParser::documentClosed(IDocument* document) | 831 | void BackgroundParser::documentClosed(IDocument* document) | ||
832 | { | 832 | { | ||
833 | QMutexLocker l(&d->m_mutex); | 833 | QMutexLocker l(&d->m_mutex); | ||
▲ Show 20 Lines • Show All 84 Lines • Show Last 20 Lines |
unrelated change(s) (also below)