From 43276feebc1bfee361cb5e5a662dbd21d32d7de0 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Tue, 3 Feb 2009 21:01:53 +0000 Subject: [PATCH] Really exclude user input while doing the sync loading of the HTML documents. (And disable/enable a connection correctly.) BUG: 178539 svn path=/trunk/KDE/kdegraphics/okular/; revision=920831 --- generators/chm/generator_chm.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/generators/chm/generator_chm.cpp b/generators/chm/generator_chm.cpp index 85e0d7517..4deca7c93 100644 --- a/generators/chm/generator_chm.cpp +++ b/generators/chm/generator_chm.cpp @@ -125,8 +125,8 @@ bool CHMGenerator::loadDocument( const QString & fileName, QVector< Okular::Page if (!m_syncGen) { m_syncGen = new KHTMLPart(); - connect (m_syncGen,SIGNAL(completed()),this,SLOT(slotCompleted())); } + disconnect( m_syncGen, 0, this, 0 ); for (int i = 0; i < m_pageUrl.count(); ++i) { @@ -135,6 +135,8 @@ bool CHMGenerator::loadDocument( const QString & fileName, QVector< Okular::Page m_syncGen->view()->contentsHeight(), Okular::Rotation0 ); } + connect( m_syncGen, SIGNAL( completed() ), this, SLOT( slotCompleted() ) ); + return true; } @@ -167,7 +169,9 @@ void CHMGenerator::preparePageForSyncOperation( int zoom , const QString & url) QEventLoop loop; connect( m_syncGen, SIGNAL( completed() ), &loop, SLOT( quit() ) ); - loop.exec(); + // discard any user input, otherwise it breaks the "synchronicity" of this + // function + loop.exec( QEventLoop::ExcludeUserInputEvents ); } void CHMGenerator::slotCompleted()