| 66 | } |
| 67 | |
| 68 | void 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 | |
| 92 | void TOC::notifyCurrentPageChanged(int, int) |
| 93 | { |
nothing calls this directly
no test coverage detected