[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdegraphics/kpdf
From:       Albert Astals Cid <tsdgeos () terra ! es>
Date:       2006-11-29 21:49:24
Message-ID: 1164836964.237137.19163.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 609253 by aacid:

Preload next and previous page if threading is enabled and not on low memory setting
BUGS: 132029


 M  +3 -2      core/observer.h  
 M  +21 -0     ui/presentationwidget.cpp  


--- branches/KDE/3.5/kdegraphics/kpdf/core/observer.h #609252:609253
@@ -24,10 +24,11 @@
 
 /** PRIORITIES for requests. Globally defined here. **/
 #define PAGEVIEW_PRIO 1
-#define PAGEVIEW_PRELOAD_PRIO 3
+#define PAGEVIEW_PRELOAD_PRIO 4
 #define THUMBNAILS_PRIO 2
-#define THUMBNAILS_PRELOAD_PRIO 4
+#define THUMBNAILS_PRELOAD_PRIO 5
 #define PRESENTATION_PRIO 0
+#define PRESENTATION_PRELOAD_PRIO 3
 
 class KPDFPage;
 
--- branches/KDE/3.5/kdegraphics/kpdf/ui/presentationwidget.cpp #609252:609253
@@ -448,6 +448,27 @@
         m_document->requestPixmaps( request );
         // restore cursor
         QApplication::restoreOverrideCursor();
+        // ask for next and previous page if not in low memory usage setting
+        if (KpdfSettings::memoryLevel() != KpdfSettings::EnumMemoryLevel::Low && \
KpdfSettings::enableThreading()) { +            QValueList< PixmapRequest * > \
asyncRequests; +            if (newPage + 1 < (int)m_document->pages())
+            {
+                PresentationFrame *nextFrame = m_frames[ newPage + 1 ];
+                pixW = nextFrame->geometry.width();
+                pixH = nextFrame->geometry.height();
+                if ( !nextFrame->page->hasPixmap( PRESENTATION_ID, pixW, pixH ) )
+                    asyncRequests.push_back( new 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 ) )
+                    asyncRequests.push_back( new PixmapRequest( PRESENTATION_ID, \
newPage - 1, pixW, pixH, PRESENTATION_PRELOAD_PRIO, true ) ); +            }
+            if (!asyncRequests.isEmpty()) m_document->requestPixmaps( asyncRequests \
); +        }
     }
     else
     {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic