mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-13 13:11:41 +00:00
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:
parent
9194097545
commit
46632f1f6f
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue