diff --git a/part.h b/part.h --- a/part.h +++ b/part.h @@ -293,6 +293,7 @@ QTimer *m_dirtyHandler; QUrl m_oldUrl; Okular::DocumentViewport m_viewportDirty; + bool m_areWeReloading; bool m_wasPresentationOpen; QWidget *m_dirtyToolboxItem; bool m_wasSidebarVisible; diff --git a/part.cpp b/part.cpp --- a/part.cpp +++ b/part.cpp @@ -294,7 +294,7 @@ QObject *parent, const QVariantList &args) : KParts::ReadWritePart(parent), -m_tempfile( 0 ), m_fileWasRemoved( false ), m_showMenuBarAction( 0 ), m_showFullScreenAction( 0 ), m_actionsSearched( false ), +m_tempfile( 0 ), m_areWeReloading( false ), m_fileWasRemoved( false ), m_showMenuBarAction( 0 ), m_showFullScreenAction( 0 ), m_actionsSearched( false ), m_cliPresentation(false), m_cliPrint(false), m_embedMode(detectEmbedMode(parentWidget, parent, args)), m_generatorGuiClient(0), m_keeper( 0 ) { // make sure that the component name is okular otherwise the XMLGUI .rc files are not found @@ -1770,6 +1770,11 @@ void Part::slotDoFileDirty() { + if (m_areWeReloading) + return; + + m_areWeReloading = true; + bool tocReloadPrepared = false; // do the following the first time the file is reloaded @@ -1810,6 +1815,7 @@ { m_toc->rollbackReload(); } + m_areWeReloading = false; return; } @@ -1850,6 +1856,7 @@ addFileToWatcher( m_watcher, localFilePath() ); m_dirtyHandler->start( 750 ); } + m_areWeReloading = false; }