diff options
author | Ken Moore <ken@ixsystems.com> | 2019-03-08 00:05:00 -0500 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2019-03-08 00:05:00 -0500 |
commit | f9a73f93168e9b3f6338278aa9d3f288c0749029 (patch) | |
tree | 6de5cbeb5016b2085e58f654bcdb5152f35e891d /src-qt5/desktop-utils/lumina-pdf/mainUI.cpp | |
parent | Two fixes for icons: (diff) | |
download | lumina-f9a73f93168e9b3f6338278aa9d3f288c0749029.tar.gz lumina-f9a73f93168e9b3f6338278aa9d3f288c0749029.tar.bz2 lumina-f9a73f93168e9b3f6338278aa9d3f288c0749029.zip |
Get lumina-pdf working with the poppler backend once again.
Also have it dynamically keep up to 5 pages in the cache at once. Load on demand as page number changes instead.
Still have some debugging enabled for further testing.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-pdf/mainUI.cpp')
-rw-r--r-- | src-qt5/desktop-utils/lumina-pdf/mainUI.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp b/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp index 1b93f3c3..8278f77a 100644 --- a/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp +++ b/src-qt5/desktop-utils/lumina-pdf/mainUI.cpp @@ -481,7 +481,13 @@ void MainUI::startLoadingPages(int degrees) { // pixelization) The best approach seams to be to increase the DPI a bit, but // match that with the same scaling on the page size (smoothing) - QSize DPI(250, 250); // print-quality (some printers even go to 600 DPI nowdays) + //QSize DPI(250, 250); // print-quality (some printers even go to 600 DPI nowdays) + + + int curpage = WIDGET->currentPage(); + if(curpage<0){ curpage = 1; } + else if(curpage>=BACKEND->numPages()){ curpage=BACKEND->numPages(); } + WIDGET->setCurrentPage(curpage); /*qDebug() << "Screen Resolutions:"; QList<QScreen*> screens = QApplication::screens(); @@ -489,7 +495,7 @@ void MainUI::startLoadingPages(int degrees) { qDebug() << screens[i]->name() << screens[i]->logicalDotsPerInchX() << screens[i]->logicalDotsPerInchY(); }*/ - int n = BACKEND->numPages() + 1; + /*int n = BACKEND->numPages() + 1; for (int i = 1; i < n; i++) { // qDebug() << " - Kickoff page load:" << i; if (BACKEND->loadMultiThread()) { @@ -500,23 +506,27 @@ void MainUI::startLoadingPages(int degrees) { QCoreApplication::processEvents(); } } - } + }*/ //qDebug() << "Finish page loading kickoff"; } void MainUI::slotSetProgress(int finished) { progress->setValue(finished); } void MainUI::slotPageLoaded(int page) { + int curpage = WIDGET->currentPage(); + if(curpage == page || (curpage <0 && page==1) ){ + //current page loaded + //qDebug() << "slotPageLoaded"; - loadingQueue.push_back(page); - int finished = loadingQueue.size(); + /*loadingQueue.push_back(page); + int finished = loadingQueue.size();*/ //qDebug() << "Page Loaded:" << page << finished; - if (finished == BACKEND->numPages()) { + //if (finished == BACKEND->numPages()) { progAct->setVisible(false); WIDGET->setVisible(true); BOOKMARKS->setVisible(true); - ui->splitter->setSizes(QList<int>() << 0 << this->width()); - WIDGET->setCurrentPage(1); + //ui->splitter->setSizes(QList<int>() << 0 << this->width()); + //WIDGET->setCurrentPage(1); ui->actionStop_Presentation->setEnabled(false); ui->actionStart_Here->setEnabled(true); ui->actionStart_Begin->setEnabled(true); |