From 46632f1f6fef6e7d7654d1b79dbd8e2dc65dd36f Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Thu, 4 Jan 2007 21:47:54 +0000 Subject: [PATCH] As now the requests are done in the right order, request first the next and then the previous page. svn path=/trunk/playground/graphics/okular/; revision=619959 --- ui/pageview.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/ui/pageview.cpp b/ui/pageview.cpp index c0fa7dc5c..5b2d99641 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -2694,16 +2694,8 @@ void PageView::slotRequestVisiblePixmaps() Okular::Settings::memoryLevel() != Okular::Settings::EnumMemoryLevel::Low && Okular::Settings::enableThreading() ) { - // add the page before the 'visible series' in preload - int headRequest = d->visibleItems.first()->pageNumber() - 1; - if ( headRequest >= 0 ) - { - PageViewItem * i = d->items[ headRequest ]; - // request the pixmap if not already present - if ( !i->page()->hasPixmap( PAGEVIEW_ID, i->width(), i->height() ) && i->width() > 0 ) - requestedPixmaps.push_back( new Okular::PixmapRequest( - PAGEVIEW_ID, i->pageNumber(), i->width(), i->height(), PAGEVIEW_PRELOAD_PRIO, true ) ); - } + // as the requests are done in the order as they appear in the list, + // request first the next page and then the previous // add the page after the 'visible series' in preload int tailRequest = d->visibleItems.last()->pageNumber() + 1; @@ -2715,6 +2707,17 @@ void PageView::slotRequestVisiblePixmaps() requestedPixmaps.push_back( new Okular::PixmapRequest( PAGEVIEW_ID, i->pageNumber(), i->width(), i->height(), PAGEVIEW_PRELOAD_PRIO, true ) ); } + + // add the page before the 'visible series' in preload + int headRequest = d->visibleItems.first()->pageNumber() - 1; + if ( headRequest >= 0 ) + { + PageViewItem * i = d->items[ headRequest ]; + // request the pixmap if not already present + if ( !i->page()->hasPixmap( PAGEVIEW_ID, i->width(), i->height() ) && i->width() > 0 ) + requestedPixmaps.push_back( new Okular::PixmapRequest( + PAGEVIEW_ID, i->pageNumber(), i->width(), i->height(), PAGEVIEW_PRELOAD_PRIO, true ) ); + } } // send requests to the document