summaryrefslogtreecommitdiff
path: root/src/plugins/help/helpplugin.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@digia.com>2012-09-18 10:05:09 +0200
committerEike Ziller <eike.ziller@digia.com>2012-09-18 10:25:01 +0200
commita5e4c2925a4f845685bce8a4094921e85bc7f93b (patch)
treeeb1f14059a51edd162cbbc901e81e5d3d29a0c69 /src/plugins/help/helpplugin.cpp
parent6d17da175f66a24143f676fc5b51a5b69b2b5cf4 (diff)
downloadqt-creator-a5e4c2925a4f845685bce8a4094921e85bc7f93b.tar.gz
Fixes: Qt Creator documentation is accumulated
Deregistering the old documentation must be delayed till the help engine is set up, because otherwise the list of registered namespaces is empty. Task-number: QTCREATORBUG-4605 Change-Id: I08288129fe24a80b7af090c3aa5dd13395bc6093 Reviewed-by: Karsten Heimrich <karsten.heimrich@nokia.com>
Diffstat (limited to 'src/plugins/help/helpplugin.cpp')
-rw-r--r--src/plugins/help/helpplugin.cpp31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp
index 2af6e437e1..9a7e0ee787 100644
--- a/src/plugins/help/helpplugin.cpp
+++ b/src/plugins/help/helpplugin.cpp
@@ -194,6 +194,8 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
SLOT(setupHelpEngineIfNeeded()));
connect(Core::HelpManager::instance(), SIGNAL(collectionFileChanged()), this,
SLOT(setupHelpEngineIfNeeded()));
+ connect(Core::HelpManager::instance(), SIGNAL(setupFinished()), this,
+ SLOT(unregisterOldQtCreatorDocumentation()));
m_splitter = new Core::MiniSplitter;
m_centralWidget = new Help::Internal::CentralWidget();
@@ -385,16 +387,6 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
void HelpPlugin::extensionsInitialized()
{
- const QString &nsInternal = QString::fromLatin1("com.nokia.qtcreator.%1%2%3")
- .arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR).arg(IDE_VERSION_RELEASE);
-
- Core::HelpManager *helpManager = Core::HelpManager::instance();
- foreach (const QString &ns, helpManager->registeredNamespaces()) {
- if (ns.startsWith(QLatin1String("com.nokia.qtcreator."))
- && ns != nsInternal)
- helpManager->unregisterDocumentation(QStringList() << ns);
- }
-
QStringList filesToRegister;
// Explicitly register qml.qch if located in creator directory. This is only
// needed for the creator-qml package, were we want to ship the documentation
@@ -406,7 +398,7 @@ void HelpPlugin::extensionsInitialized()
// we might need to register creators inbuild help
filesToRegister.append(QDir::cleanPath(appPath
+ QLatin1String(DOCPATH "qtcreator.qch")));
- helpManager->registerDocumentation(filesToRegister);
+ Core::HelpManager::instance()->registerDocumentation(filesToRegister);
}
ExtensionSystem::IPlugin::ShutdownFlag HelpPlugin::aboutToShutdown()
@@ -428,6 +420,23 @@ ExtensionSystem::IPlugin::ShutdownFlag HelpPlugin::aboutToShutdown()
return SynchronousShutdown;
}
+void HelpPlugin::unregisterOldQtCreatorDocumentation()
+{
+ const QString &nsInternal = QString::fromLatin1("com.nokia.qtcreator.%1%2%3")
+ .arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR).arg(IDE_VERSION_RELEASE);
+
+ Core::HelpManager *helpManager = Core::HelpManager::instance();
+ QStringList documentationToUnregister;
+ foreach (const QString &ns, helpManager->registeredNamespaces()) {
+ if (ns.startsWith(QLatin1String("com.nokia.qtcreator."))
+ && ns != nsInternal) {
+ documentationToUnregister << ns;
+ }
+ }
+ if (!documentationToUnregister.isEmpty())
+ helpManager->unregisterDocumentation(documentationToUnregister);
+}
+
void HelpPlugin::setupUi()
{
// side bar widgets and shortcuts