From bdd4fa1c0d03b48e2e34aa4cd8a175722310c695 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Sat, 3 May 2008 12:34:49 +0000 Subject: [PATCH] make sure we keep next and previous pages if we are on aggresive mode svn path=/trunk/KDE/kdegraphics/okular/; revision=803592 --- ui/presentationwidget.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ui/presentationwidget.cpp b/ui/presentationwidget.cpp index 30d754832..5a54f9b81 100644 --- a/ui/presentationwidget.cpp +++ b/ui/presentationwidget.cpp @@ -295,8 +295,16 @@ void PresentationWidget::notifyPageChanged( int pageNumber, int changedFlags ) bool PresentationWidget::canUnloadPixmap( int pageNumber ) const { - // can unload all pixmaps except for the currently visible one - return pageNumber != m_frameIndex; + if ( Okular::Settings::memoryLevel() != Okular::Settings::EnumMemoryLevel::Aggressive ) + { + // can unload all pixmaps except for the currently visible one + return pageNumber != m_frameIndex; + } + else + { + // can unload all pixmaps except for the currently visible one, previous and next + return qAbs(pageNumber - m_frameIndex) <= 1; + } } void PresentationWidget::setupActions( KActionCollection * collection )