View orientation cached in memory.

Cache the view orientation in memory to anticipate
a document reload.

CCBUG: 184518
This commit is contained in:
Christopher Reichert 2011-06-25 17:14:04 -05:00
parent 5be0a98725
commit a9354072ad
2 changed files with 5 additions and 0 deletions

View File

@ -1239,6 +1239,9 @@ void Part::slotDoFileDirty()
// store if presentation view was open
m_wasPresentationOpen = ((PresentationWidget*)m_presentationWidget != 0);
// store the page rotation
m_dirtyPageRotation = m_document->rotation();
// inform the user about the operation in progress
m_pageView->displayMessage( i18n("Reloading the document...") );
}
@ -1251,6 +1254,7 @@ void Part::slotDoFileDirty()
m_viewportDirty.pageNumber = (int) m_document->pages() - 1;
m_document->setViewport( m_viewportDirty );
m_viewportDirty.pageNumber = -1;
m_document->setRotation( m_dirtyPageRotation );
if ( m_sidebar->currentIndex() != m_dirtyToolboxIndex && m_sidebar->isItemEnabled( m_dirtyToolboxIndex ) )
{
m_sidebar->setCurrentIndex( m_dirtyToolboxIndex );

1
part.h
View File

@ -220,6 +220,7 @@ class Part : public KParts::ReadOnlyPart, public Okular::DocumentObserver, publi
int m_dirtyToolboxIndex;
bool m_wasSidebarVisible;
bool m_fileWasRemoved;
Rotation m_dirtyPageRotation;
// Remember the search history
QStringList m_searchHistory;