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
This commit is contained in:
Pino Toscano 2007-01-04 21:47:54 +00:00
parent 9194097545
commit 46632f1f6f

View file

@ -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