Assistant: Fix index updating on startup in the remote control mode
authorAlexander Volkov <a.volkov@rusbitech.ru>
Fri, 19 Sep 2014 09:52:42 +0000 (13:52 +0400)
committerShawn Rutledge <shawn.rutledge@digia.com>
Mon, 13 Oct 2014 09:42:59 +0000 (11:42 +0200)
HelpEngineWrapper::initialDocSetupDone() should be called only once
right after the initialization of the help models. Calling it on
every small update leads to recursion.

Task-number: QTBUG-36850
Change-Id: I16cae03f08bbc9a19ec9298c84c602a4046dce93
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@digia.com>
src/assistant/assistant/mainwindow.cpp

index 3a3c0e8..491929e 100644 (file)
@@ -484,9 +484,10 @@ void MainWindow::qtDocumentationInstalled()
 void MainWindow::checkInitState()
 {
     TRACE_OBJ
-    HelpEngineWrapper::instance().initialDocSetupDone();
-    if (!m_cmdLine->enableRemoteControl())
+    if (!m_cmdLine->enableRemoteControl()) {
+        HelpEngineWrapper::instance().initialDocSetupDone();
         return;
+    }
 
     HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance();
     if (helpEngine.contentModel()->isCreatingContents()
@@ -503,6 +504,7 @@ void MainWindow::checkInitState()
             disconnect(helpEngine.contentModel(), 0, this, 0);
             disconnect(helpEngine.indexModel(), 0, this, 0);
         }
+        HelpEngineWrapper::instance().initialDocSetupDone();
         emit initDone();
     }
 }