diff --git a/part.cpp b/part.cpp index 9e53dae39..0099d7a76 100644 --- a/part.cpp +++ b/part.cpp @@ -842,14 +842,12 @@ void Part::showSourceLocation(const QString& fileName, int line, int column, boo if( showGraphically ) { m_pageView->setLastSourceLocationViewport( m_document->viewport() ); - m_pageView->viewport()->update(); } } void Part::clearLastShownSourceLocation() { m_pageView->clearLastSourceLocationViewport(); - m_pageView->viewport()->update(); } bool Part::isWatchFileModeEnabled() const @@ -872,17 +870,12 @@ void Part::setWatchFileModeEnabled(bool enabled) bool Part::areSourceLocationsShownGraphically() const { - return Okular::Settings::showSourceLocationsGraphically(); + return m_pageView->areSourceLocationsShownGraphically(); } void Part::setShowSourceLocationsGraphically(bool show) { - if( show == Okular::Settings::showSourceLocationsGraphically() ) - { - return; - } - Okular::Settings::setShowSourceLocationsGraphically( show ); - m_pageView->viewport()->update(); + m_pageView->setShowSourceLocationsGraphically(show); } void Part::slotHandleActivatedSourceReference(const QString& absFileName, int line, int col, bool *handled) diff --git a/ui/pageview.cpp b/ui/pageview.cpp index eebdf46ff..0c0ff98f8 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -965,6 +965,21 @@ void PageView::updateActionState( bool haspages, bool documentChanged, bool hasf } } +bool PageView::areSourceLocationsShownGraphically() const +{ + return Okular::Settings::showSourceLocationsGraphically(); +} + +void PageView::setShowSourceLocationsGraphically(bool show) +{ + if( show == Okular::Settings::showSourceLocationsGraphically() ) + { + return; + } + Okular::Settings::setShowSourceLocationsGraphically( show ); + viewport()->update(); +} + void PageView::setLastSourceLocationViewport( const Okular::DocumentViewport& vp ) { if( vp.rePos.enabled ) @@ -978,6 +993,7 @@ void PageView::setLastSourceLocationViewport( const Okular::DocumentViewport& vp d->lastSourceLocationViewportNormalizedY = 0.0; } d->lastSourceLocationViewportPageNumber = vp.pageNumber; + viewport()->update(); } void PageView::clearLastSourceLocationViewport() @@ -985,6 +1001,7 @@ void PageView::clearLastSourceLocationViewport() d->lastSourceLocationViewportPageNumber = -1; d->lastSourceLocationViewportNormalizedX = 0.0; d->lastSourceLocationViewportNormalizedY = 0.0; + viewport()->update(); } void PageView::notifyViewportChanged( bool smoothMove ) diff --git a/ui/pageview.h b/ui/pageview.h index 9fac70679..63b0af04e 100644 --- a/ui/pageview.h +++ b/ui/pageview.h @@ -103,6 +103,9 @@ Q_OBJECT QPoint contentAreaPosition() const; QPoint contentAreaPoint( const QPoint & pos ) const; + bool areSourceLocationsShownGraphically() const; + void setShowSourceLocationsGraphically(bool show); + void setLastSourceLocationViewport( const Okular::DocumentViewport& vp ); void clearLastSourceLocationViewport(); public slots: