One single char remove to create correctly the queue of pixmap requests: new asynchronous requests goes as last one in the group of other with the same priority.

Thus, if an observer requests eg pixmap for pages 2 and 3, now they are generated in the correct order the observer specified, and not in the reversed one.
Then, revert part of r619673, as the order is fixed now.

svn path=/trunk/playground/graphics/okular/; revision=619810
remotes/origin/KDE/4.0
Pino Toscano 19 years ago
parent 6c4fac7c72
commit 4aa85cdb49
  1. 2
      core/document.cpp
  2. 16
      ui/presentationwidget.cpp

@ -1179,7 +1179,7 @@ void Document::requestPixmaps( const QLinkedList< PixmapRequest * > & requests )
// insert in stack sorted by priority
sIt = d->m_pixmapRequestsStack.begin();
sEnd = d->m_pixmapRequestsStack.end();
while ( sIt != sEnd && (*sIt)->priority() >= request->priority() )
while ( sIt != sEnd && (*sIt)->priority() > request->priority() )
++sIt;
d->m_pixmapRequestsStack.insert( sIt, request );
}

@ -595,14 +595,6 @@ void PresentationWidget::changePage( int newPage )
QApplication::restoreOverrideCursor();
// ask for next and previous page if not in low memory usage setting
if (Okular::Settings::memoryLevel() != Okular::Settings::EnumMemoryLevel::Low && Okular::Settings::enableThreading()) {
if (newPage - 1 >= 0)
{
PresentationFrame *prevFrame = m_frames[ newPage - 1 ];
pixW = prevFrame->geometry.width();
pixH = prevFrame->geometry.height();
if ( !prevFrame->page->hasPixmap( PRESENTATION_ID, pixW, pixH ) )
requests.push_back( new Okular::PixmapRequest( PRESENTATION_ID, newPage - 1, pixW, pixH, PRESENTATION_PRELOAD_PRIO, true ) );
}
if (newPage + 1 < (int)m_document->pages())
{
PresentationFrame *nextFrame = m_frames[ newPage + 1 ];
@ -611,6 +603,14 @@ void PresentationWidget::changePage( int newPage )
if ( !nextFrame->page->hasPixmap( PRESENTATION_ID, pixW, pixH ) )
requests.push_back( new Okular::PixmapRequest( PRESENTATION_ID, newPage + 1, pixW, pixH, PRESENTATION_PRELOAD_PRIO, true ) );
}
if (newPage - 1 >= 0)
{
PresentationFrame *prevFrame = m_frames[ newPage - 1 ];
pixW = prevFrame->geometry.width();
pixH = prevFrame->geometry.height();
if ( !prevFrame->page->hasPixmap( PRESENTATION_ID, pixW, pixH ) )
requests.push_back( new Okular::PixmapRequest( PRESENTATION_ID, newPage - 1, pixW, pixH, PRESENTATION_PRELOAD_PRIO, true ) );
}
}
m_document->requestPixmaps( requests );
}

Loading…
Cancel
Save