aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-pdf/Renderer-poppler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/desktop-utils/lumina-pdf/Renderer-poppler.cpp')
-rw-r--r--src-qt5/desktop-utils/lumina-pdf/Renderer-poppler.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src-qt5/desktop-utils/lumina-pdf/Renderer-poppler.cpp b/src-qt5/desktop-utils/lumina-pdf/Renderer-poppler.cpp
index 6e5ff382..8f0755d4 100644
--- a/src-qt5/desktop-utils/lumina-pdf/Renderer-poppler.cpp
+++ b/src-qt5/desktop-utils/lumina-pdf/Renderer-poppler.cpp
@@ -154,13 +154,13 @@ void Renderer::renderPage(int pagenum, QSize DPI, int degrees) {
}
if (pagesStillLoading == 1) {
- emit PageLoaded();
+ emit PageLoaded(pagenum);
}
--pagesStillLoading;
}
-bool Renderer::isDoneLoading() { return pagesStillLoading == 0; }
+bool Renderer::isDoneLoading(int page) { return imageCache.contains(page); }
QList<TextData *> Renderer::searchDocument(QString text, bool matchCase) {
QList<TextData *> results;
@@ -177,9 +177,13 @@ QList<TextData *> Renderer::searchDocument(QString text, bool matchCase) {
return results;
}
-QSize Renderer::imageSize(int pagenum) { return pages[pagenum].size(); }
+QSize Renderer::imageSize(int pagenum) {
+ if(!imageCache.contains(pagenum)){ return QSize(); }
+ return pages[pagenum].size();
+}
QImage Renderer::imageHash(int pagenum) {
+ if(!imageCache.contains(pagenum)){ return QImage(); }
// while(pagesStillLoading > 0) { qDebug() << "pagesStillLoading!\n";}
std::optional<QImage> cachedImage = imageCache.get(pagenum);
bgstack15