Commit a6aea956 authored by Albert Astals Cid's avatar Albert Astals Cid

Do not start reloading again if we're reloading

If you press and hold F5 we try to reload multiple times, which isn't a nice idea, let's finish one before starting the next
parent 8ca27ef3
......@@ -294,7 +294,7 @@ Part::Part(QWidget *parentWidget,
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_isReloading( 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
......@@ -1773,6 +1773,12 @@ void Part::slotFileDirty( const QString& path )
void Part::slotDoFileDirty()
{
// Skip reload when another reload is already in progress
if ( m_isReloading ) {
return;
}
QScopedValueRollback<bool> rollback(m_isReloading, true);
bool tocReloadPrepared = false;
// do the following the first time the file is reloaded
......
......@@ -293,6 +293,7 @@ class OKULARPART_EXPORT Part : public KParts::ReadWritePart, public Okular::Docu
QTimer *m_dirtyHandler;
QUrl m_oldUrl;
Okular::DocumentViewport m_viewportDirty;
bool m_isReloading;
bool m_wasPresentationOpen;
QWidget *m_dirtyToolboxItem;
bool m_wasSidebarVisible;
......
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