MCPcopy Create free account
hub / github.com/KDE/okular / removeObserver

Method removeObserver

core/document.cpp:2759–2790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2757}
2758
2759void Document::removeObserver(DocumentObserver *pObserver)
2760{
2761 // remove observer from the set. it won't receive notifications anymore
2762 if (d->m_observers.contains(pObserver)) {
2763 // free observer's pixmap data
2764 for (Page *const page : std::as_const(d->m_pagesVector)) {
2765 page->deletePixmap(pObserver);
2766 }
2767
2768 // [MEM] free observer's allocation descriptors
2769 auto aIt = d->m_allocatedPixmaps.begin();
2770 auto aEnd = d->m_allocatedPixmaps.end();
2771 while (aIt != aEnd) {
2772 AllocatedPixmap *p = *aIt;
2773 if (p->observer == pObserver) {
2774 aIt = d->m_allocatedPixmaps.erase(aIt);
2775 delete p;
2776 } else {
2777 ++aIt;
2778 }
2779 }
2780
2781 for (PixmapRequest *executingRequest : std::as_const(d->m_executingPixmapRequests)) {
2782 if (executingRequest->observer() == pObserver) {
2783 d->cancelRenderingBecauseOf(executingRequest, nullptr);
2784 }
2785 }
2786
2787 // remove observer entry from the set
2788 d->m_observers.remove(pObserver);
2789 }
2790}
2791
2792void Document::reparseConfig()
2793{

Callers 15

testExifOrientationMethod · 0.80
~SignatureModelMethod · 0.80
~PageSizeLabelMethod · 0.80
~AnnotationModelMethod · 0.80
~BookmarkListMethod · 0.80
~SignaturePanelMethod · 0.80
~LayersMethod · 0.80
~MiniBarLogicMethod · 0.80
~ProgressWidgetMethod · 0.80
~ReviewsMethod · 0.80
~TOCMethod · 0.80

Calls 5

deletePixmapMethod · 0.80
containsMethod · 0.60
endMethod · 0.45
observerMethod · 0.45

Tested by 1

testExifOrientationMethod · 0.64