Help: Clean up automatically registered documentation

It would keep documentation registered as long as the files are still
there, but that is actually not what is wanted. If you remove a Qt
version from Qt Creator, or switch between different Qt Creator
installations with different auto-detected Qt versions, the registered
documentation should be updated.
This also reduces the number of open files in these cases.

We keep a list of manually added documentation in the settings and treat
all other documentation as automatically managed.

Change-Id: I542f9aee0e62cab70db5afc5c6d6764d84cb253d
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
This commit is contained in:
Eike Ziller
2014-12-02 17:51:14 +01:00
parent a1f8be4471
commit 877d482c85
6 changed files with 89 additions and 43 deletions

View File

@@ -170,8 +170,6 @@ bool HelpPlugin::initialize(const QStringList &arguments, QString *error)
SLOT(setupHelpEngineIfNeeded()));
connect(HelpManager::instance(), SIGNAL(collectionFileChanged()), this,
SLOT(setupHelpEngineIfNeeded()));
connect(HelpManager::instance(), SIGNAL(setupFinished()), this,
SLOT(unregisterOldQtCreatorDocumentation()));
Command *cmd;
QAction *action;
@@ -265,22 +263,6 @@ ExtensionSystem::IPlugin::ShutdownFlag HelpPlugin::aboutToShutdown()
return SynchronousShutdown;
}
void HelpPlugin::unregisterOldQtCreatorDocumentation()
{
const QString &nsInternal = QString::fromLatin1("org.qt-project.qtcreator.%1%2%3")
.arg(IDE_VERSION_MAJOR).arg(IDE_VERSION_MINOR).arg(IDE_VERSION_RELEASE);
QStringList documentationToUnregister;
foreach (const QString &ns, HelpManager::registeredNamespaces()) {
if (ns.startsWith(QLatin1String("org.qt-project.qtcreator."))
&& ns != nsInternal) {
documentationToUnregister << ns;
}
}
if (!documentationToUnregister.isEmpty())
HelpManager::unregisterDocumentation(documentationToUnregister);
}
void HelpPlugin::resetFilter()
{
const QString &filterInternal = QString::fromLatin1("Qt Creator %1.%2.%3")