Commit ab436aaa authored by Michel Ludwig's avatar Michel Ludwig
Browse files

Better move the calls to 'viewport()->update()' relating to the...

Better move the calls to 'viewport()->update()' relating to the ViewerInterface inside the PageView class.
parent d02c86fe
......@@ -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)
......
......@@ -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 )
......
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment