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

Method notifySetup

part/toc.cpp:68–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void TOC::notifySetup(const QList<Okular::Page *> & /*pages*/, int setupFlags)
69{
70 if (!(setupFlags & Okular::DocumentObserver::DocumentChanged)) {
71 return;
72 }
73
74 // clear contents
75 m_model->clear();
76
77 // request synopsis description (is a dom tree)
78 const Okular::DocumentSynopsis *syn = m_document->documentSynopsis();
79 if (!syn) {
80 if (m_document->isOpened()) {
81 // Make sure we clear the reload old model data
82 m_model->setOldModelData(nullptr, QList<QModelIndex>());
83 }
84 Q_EMIT hasTOC(false);
85 return;
86 }
87
88 m_model->fill(syn);
89 Q_EMIT hasTOC(!m_model->isEmpty());
90}
91
92void TOC::notifyCurrentPageChanged(int, int)
93{

Callers

nothing calls this directly

Calls 6

documentSynopsisMethod · 0.80
setOldModelDataMethod · 0.80
fillMethod · 0.80
isEmptyMethod · 0.80
clearMethod · 0.45
isOpenedMethod · 0.45

Tested by

no test coverage detected