mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-24 18:35:37 +00:00
fordward port r595680
******* When reloading a document because it changed still be in presentation mode after the reload ******* and while at it make the document reloading work again svn path=/trunk/playground/graphics/okular/; revision=595690
This commit is contained in:
parent
2b143ca661
commit
0d942a0cce
|
@ -257,7 +257,7 @@ bool PDFGenerator::loadDocument( const QString & filePath, QVector<Okular::Page*
|
|||
bool firstInput = true;
|
||||
bool triedWallet = false;
|
||||
KWallet::Wallet * wallet = 0;
|
||||
while ( !pdfdoc && pdfdoc->isLocked() )
|
||||
while ( pdfdoc && pdfdoc->isLocked() )
|
||||
{
|
||||
QByteArray password;
|
||||
|
||||
|
|
11
part.cpp
11
part.cpp
|
@ -79,7 +79,7 @@ K_EXPORT_COMPONENT_FACTORY(libokularpart, okularPartFactory)
|
|||
Part::Part(QWidget *parentWidget,
|
||||
QObject *parent,
|
||||
const QStringList & /*args*/ )
|
||||
: KParts::ReadOnlyPart(parent), m_viewportDirty( 0 ),
|
||||
: KParts::ReadOnlyPart(parent),
|
||||
m_showMenuBarAction(0), m_showFullScreenAction(0), m_actionsSearched(false),
|
||||
m_searchStarted(false)
|
||||
{
|
||||
|
@ -619,7 +619,7 @@ bool Part::openUrl(const KUrl &url)
|
|||
|
||||
if ( openOk )
|
||||
{
|
||||
m_viewportDirty = 0;
|
||||
m_viewportDirty.pageNumber = -1;
|
||||
|
||||
// if the document have a 'DocumentTitle' flag set (and it is not empty), set it as title
|
||||
QString title = m_document->getMetaData( "DocumentTitle" );
|
||||
|
@ -727,7 +727,11 @@ void Part::slotDoFileDirty()
|
|||
if ( m_viewportDirty.pageNumber == -1 )
|
||||
{
|
||||
// store the current viewport
|
||||
m_viewportDirty = Okular::DocumentViewport( m_document->viewport() );
|
||||
m_viewportDirty = m_document->viewport();
|
||||
|
||||
// store if presentation view was open
|
||||
qDebug("PRESENTATION %lx", (PresentationWidget*)m_presentationWidget);
|
||||
m_wasPresentationOpen = ((PresentationWidget*)m_presentationWidget != 0);
|
||||
|
||||
// inform the user about the operation in progress
|
||||
m_pageView->displayMessage( i18n("Reloading the document...") );
|
||||
|
@ -741,6 +745,7 @@ void Part::slotDoFileDirty()
|
|||
m_viewportDirty.pageNumber = (int) m_document->pages() - 1;
|
||||
m_document->setViewport( m_viewportDirty );
|
||||
m_viewportDirty.pageNumber = -1;
|
||||
if (m_wasPresentationOpen) slotShowPresentation();
|
||||
emit enablePrintAction(true);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue