summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-02-15 23:06:18 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-02-15 23:06:18 (GMT)
commit643a2ada050e664d6c46dc943d439071ce4c372a (patch)
tree70f00c18176024a17f3159e8fc60f409ba30b5a1 /tools
parent42dda19d82ceea48f19d356cfaf2b26acb763df8 (diff)
parente885e8123fbe0d57a0d8a4c8115ea43dde31b05d (diff)
downloadQt-643a2ada050e664d6c46dc943d439071ce4c372a.zip
Qt-643a2ada050e664d6c46dc943d439071ce4c372a.tar.gz
Qt-643a2ada050e664d6c46dc943d439071ce4c372a.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/berlin-staging-1 into master-integration
* 'master' of scm.dev.nokia.troll.no:qt/berlin-staging-1: Assistant: Rebuild search index at most once at start-up. Prepare translations of the declarative module.
Diffstat (limited to 'tools')
-rw-r--r--tools/assistant/tools/assistant/helpenginewrapper.cpp28
-rw-r--r--tools/assistant/tools/assistant/helpenginewrapper.h6
-rw-r--r--tools/assistant/tools/assistant/mainwindow.cpp3
3 files changed, 34 insertions, 3 deletions
diff --git a/tools/assistant/tools/assistant/helpenginewrapper.cpp b/tools/assistant/tools/assistant/helpenginewrapper.cpp
index 76211c5..a181c71 100644
--- a/tools/assistant/tools/assistant/helpenginewrapper.cpp
+++ b/tools/assistant/tools/assistant/helpenginewrapper.cpp
@@ -112,6 +112,7 @@ private:
QFileSystemWatcher * const m_qchWatcher;
typedef QPair<QDateTime, QSharedPointer<TimeoutForwarder> > RecentSignal;
QMap<QString, RecentSignal> m_recentQchUpdates;
+ bool m_initialReindexingNeeded;
};
const QString HelpEngineWrapper::TrUnfiltered = tr("Unfiltered");
@@ -141,6 +142,18 @@ HelpEngineWrapper::HelpEngineWrapper(const QString &collectionFile)
: d(new HelpEngineWrapperPrivate(collectionFile))
{
TRACE_OBJ
+
+ /*
+ * Otherwise we will waste time if several new docs are found,
+ * because we will start to index them, only to be interupted
+ * by the next request. Also, there is a nasty SQLITE bug that will
+ * cause the application to hang for minutes in that case.
+ * This call is reverted by initalDocSetupDone(), which must be
+ * called after the new docs have been installed.
+ */
+ disconnect(d->m_helpEngine, SIGNAL(setupFinished()),
+ searchEngine(), SLOT(indexDocumentation()));
+
connect(d, SIGNAL(documentationRemoved(QString)),
this, SIGNAL(documentationRemoved(QString)));
connect(d, SIGNAL(documentationUpdated(QString)),
@@ -157,6 +170,15 @@ HelpEngineWrapper::~HelpEngineWrapper()
delete d;
}
+void HelpEngineWrapper::initialDocSetupDone()
+{
+ TRACE_OBJ
+ connect(d->m_helpEngine, SIGNAL(setupFinished()),
+ searchEngine(), SLOT(indexDocumentation()));
+ if (d->m_initialReindexingNeeded)
+ setupData();
+}
+
QHelpSearchEngine *HelpEngineWrapper::searchEngine() const
{
TRACE_OBJ
@@ -207,6 +229,7 @@ bool HelpEngineWrapper::registerDocumentation(const QString &docFile)
return false;
d->m_qchWatcher->addPath(docFile);
d->checkDocFilesWatched();
+ d->m_initialReindexingNeeded = true;
return true;
}
@@ -219,6 +242,7 @@ bool HelpEngineWrapper::unregisterDocumentation(const QString &namespaceName)
return false;
d->m_qchWatcher->removePath(file);
d->checkDocFilesWatched();
+ d->m_initialReindexingNeeded = true;
return true;
}
@@ -698,7 +722,8 @@ void TimeoutForwarder::forward()
HelpEngineWrapperPrivate::HelpEngineWrapperPrivate(const QString &collectionFile)
: m_helpEngine(new QHelpEngine(collectionFile, this)),
- m_qchWatcher(new QFileSystemWatcher(this))
+ m_qchWatcher(new QFileSystemWatcher(this)),
+ m_initialReindexingNeeded(false)
{
TRACE_OBJ
if (!m_helpEngine->customFilters().contains(Unfiltered))
@@ -797,6 +822,7 @@ void HelpEngineWrapperPrivate::qchFileChanged(const QString &fileName,
} else {
emit documentationUpdated(ns);
}
+ m_initialReindexingNeeded = true;
m_helpEngine->setupData();
}
m_recentQchUpdates.erase(it);
diff --git a/tools/assistant/tools/assistant/helpenginewrapper.h b/tools/assistant/tools/assistant/helpenginewrapper.h
index a30fab8..8d95273 100644
--- a/tools/assistant/tools/assistant/helpenginewrapper.h
+++ b/tools/assistant/tools/assistant/helpenginewrapper.h
@@ -101,6 +101,12 @@ public:
const QStringList filterAttributes(const QString &filterName) const;
QString error() const;
+ /*
+ * To be called after assistant has finished looking for new documentation.
+ * This will mainly cause the search index to be updated, if necessary.
+ */
+ void initialDocSetupDone();
+
const QStringList qtDocInfo(const QString &component) const;
void setQtDocInfo(const QString &component, const QStringList &doc);
diff --git a/tools/assistant/tools/assistant/mainwindow.cpp b/tools/assistant/tools/assistant/mainwindow.cpp
index 4115d39..8096218 100644
--- a/tools/assistant/tools/assistant/mainwindow.cpp
+++ b/tools/assistant/tools/assistant/mainwindow.cpp
@@ -354,8 +354,6 @@ void MainWindow::lookForNewQtDocumentation()
void MainWindow::qtDocumentationInstalled(bool newDocsInstalled)
{
TRACE_OBJ
- if (newDocsInstalled)
- HelpEngineWrapper::instance().setupData();
statusBar()->clearMessage();
checkInitState();
}
@@ -383,6 +381,7 @@ void MainWindow::checkInitState()
}
emit initDone();
}
+ HelpEngineWrapper::instance().initialDocSetupDone();
}
void MainWindow::insertLastPages()