Hello,

I've been using Okular in "Facing mode" and observed that only
the first of the two next pages was preloaded. This patch that
I've attached provides preloading for two pages when viewing
in "Facing Pages" mode.

Thanks,
Igor

-- 
:wq
--- pageview-orig.cpp	2009-09-20 15:32:54.000000000 +0300
+++ pageview.cpp	2009-09-20 15:32:58.000000000 +0300
@@ -3107,6 +3107,19 @@
                         PAGEVIEW_ID, i->pageNumber(), i->uncroppedWidth(), i->uncroppedHeight(), PAGEVIEW_PRELOAD_PRIO, true ) );
         }
 
+        // cache an additional page for two page view
+        if (Okular::Settings::viewMode() == 1) {
+            int tailRequest2 = d->visibleItems.last()->pageNumber() + 2;
+            if ( tailRequest2 < (int)d->items.count() )
+            {
+                PageViewItem * i = d->items[ tailRequest2 ];
+                // request the pixmap if not already present
+                if ( !i->page()->hasPixmap( PAGEVIEW_ID, i->uncroppedWidth(), i->uncroppedHeight() ) && i->uncroppedWidth() > 0 )
+                    requestedPixmaps.push_back( new Okular::PixmapRequest(
+                                PAGEVIEW_ID, i->pageNumber(), i->uncroppedWidth(), i->uncroppedHeight(), PAGEVIEW_PRELOAD_PRIO, true ) );
+            }
+        }
+
         // add the page before the 'visible series' in preload
         int headRequest = d->visibleItems.first()->pageNumber() - 1;
         if ( headRequest >= 0 )
_______________________________________________
Okular-devel mailing list
Okular-devel@kde.org
https://mail.kde.org/mailman/listinfo/okular-devel

Reply via email to