| 2790 | } |
| 2791 | |
| 2792 | void Document::reparseConfig() |
| 2793 | { |
| 2794 | // reparse generator config and if something changed clear Pages |
| 2795 | bool configchanged = false; |
| 2796 | if (d->m_generator) { |
| 2797 | Okular::ConfigInterface *iface = qobject_cast<Okular::ConfigInterface *>(d->m_generator); |
| 2798 | if (iface) { |
| 2799 | configchanged = iface->reparseConfig(); |
| 2800 | } |
| 2801 | } |
| 2802 | if (configchanged) { |
| 2803 | // invalidate pixmaps |
| 2804 | for (Page *const page : std::as_const(d->m_pagesVector)) { |
| 2805 | page->deletePixmaps(); |
| 2806 | } |
| 2807 | |
| 2808 | // [MEM] remove allocation descriptors |
| 2809 | qDeleteAll(d->m_allocatedPixmaps); |
| 2810 | d->m_allocatedPixmaps.clear(); |
| 2811 | d->m_allocatedPixmapsTotalMemory = 0; |
| 2812 | |
| 2813 | // send reload signals to observers |
| 2814 | foreachObserver(notifyContentsCleared(DocumentObserver::Pixmap)); |
| 2815 | } |
| 2816 | |
| 2817 | // free memory if in 'low' profile |
| 2818 | if (SettingsCore::memoryLevel() == SettingsCore::EnumMemoryLevel::Low && !d->m_allocatedPixmaps.empty() && !d->m_pagesVector.isEmpty()) { |
| 2819 | d->cleanupPixmapMemory(); |
| 2820 | } |
| 2821 | } |
| 2822 | |
| 2823 | bool Document::isOpened() const |
| 2824 | { |
no test coverage detected