From 4aa85cdb493bde06855c6fc03cd58281149c0eb4 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Thu, 4 Jan 2007 14:28:54 +0000 Subject: [PATCH] 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 --- core/document.cpp | 2 +- ui/presentationwidget.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/document.cpp b/core/document.cpp index a0ec4c45d..ffd5c9049 100644 --- a/core/document.cpp +++ b/core/document.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 ); } diff --git a/ui/presentationwidget.cpp b/ui/presentationwidget.cpp index 9c2f215cd..ae9a1745d 100644 --- a/ui/presentationwidget.cpp +++ b/ui/presentationwidget.cpp @@ -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 ); }