summaryrefslogtreecommitdiff
path: root/src/plugins/cppeditor/cpphoverhandler.cpp
diff options
context:
space:
mode:
authorcon <qtc-committer@nokia.com>2010-06-11 16:30:39 +0200
committercon <qtc-committer@nokia.com>2010-06-11 16:30:39 +0200
commit30fae3eab1f7dcab5cb9fab96956b74a1c7a4ab8 (patch)
treeb87c2378b4578564728f85359eb8a96a5b7574ff /src/plugins/cppeditor/cpphoverhandler.cpp
parentce80ee4f5e14eae425fd99c570885ac3e39814c6 (diff)
parent5e40846c2360877ddfbd54760e85b45929561373 (diff)
downloadqt-creator-30fae3eab1f7dcab5cb9fab96956b74a1c7a4ab8.tar.gz
Merge remote branch 'origin/2.0'
Conflicts: doc/qtcreator.qdoc src/plugins/projectexplorer/taskwindow.h src/plugins/qmldesigner/designercore/model/modelmerger.cpp src/plugins/qmljseditor/qmljshoverhandler.h src/plugins/qt4projectmanager/Qt4ProjectManager.pluginspec src/plugins/qt4projectmanager/qt-maemo/maemopackagecreationwidget.cpp src/plugins/subversion/subversionplugin.cpp
Diffstat (limited to 'src/plugins/cppeditor/cpphoverhandler.cpp')
-rw-r--r--src/plugins/cppeditor/cpphoverhandler.cpp30
1 files changed, 4 insertions, 26 deletions
diff --git a/src/plugins/cppeditor/cpphoverhandler.cpp b/src/plugins/cppeditor/cpphoverhandler.cpp
index 2f7bd05179..bfc0381500 100644
--- a/src/plugins/cppeditor/cpphoverhandler.cpp
+++ b/src/plugins/cppeditor/cpphoverhandler.cpp
@@ -32,6 +32,7 @@
#include "cppplugin.h"
#include <coreplugin/icore.h>
+#include <coreplugin/helpmanager.h>
#include <coreplugin/uniqueidmanager.h>
#include <coreplugin/editormanager/editormanager.h>
#include <cpptools/cppmodelmanagerinterface.h>
@@ -60,7 +61,6 @@
#include <QtGui/QToolTip>
#include <QtGui/QTextCursor>
#include <QtGui/QTextBlock>
-#include <QtHelp/QHelpEngineCore>
using namespace CppEditor::Internal;
using namespace CPlusPlus;
@@ -68,27 +68,11 @@ using namespace Core;
CppHoverHandler::CppHoverHandler(QObject *parent)
: QObject(parent)
- , m_helpEngineNeedsSetup(false)
{
m_modelManager = ExtensionSystem::PluginManager::instance()->getObject<CppTools::CppModelManagerInterface>();
- ICore *core = ICore::instance();
- QFileInfo fi(core->settings()->fileName());
- // FIXME shouldn't the help engine create the directory if it doesn't exist?
- QDir directory(fi.absolutePath()+"/qtcreator");
- if (!directory.exists())
- directory.mkpath(directory.absolutePath());
-
- m_helpEngine = new QHelpEngineCore(directory.absolutePath()
- + QLatin1String("/helpcollection.qhc"), this);
- if (!m_helpEngine->setupData())
- qWarning() << "Could not initialize help engine:" << m_helpEngine->error();
- m_helpEngine->setAutoSaveFilter(false);
- m_helpEngine->setCurrentFilter(tr("Unfiltered"));
- m_helpEngineNeedsSetup = m_helpEngine->registeredDocumentations().count() == 0;
-
// Listen for editor opened events in order to connect to tooltip/helpid requests
- connect(core->editorManager(), SIGNAL(editorOpened(Core::IEditor *)),
+ connect(ICore::instance()->editorManager(), SIGNAL(editorOpened(Core::IEditor *)),
this, SLOT(editorOpened(Core::IEditor *)));
}
@@ -221,19 +205,13 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
}
}
- if (m_helpEngineNeedsSetup
- && m_helpEngine->registeredDocumentations().count() > 0) {
- m_helpEngine->setupData();
- m_helpEngineNeedsSetup = false;
- }
QMap<QString, QUrl> helpLinks;
-
if (m_toolTip.isEmpty()) {
foreach (const Document::Include &incl, doc->includes()) {
if (incl.line() == lineNumber) {
m_toolTip = QDir::toNativeSeparators(incl.fileName());
m_helpId = QFileInfo(incl.fileName()).fileName();
- helpLinks = m_helpEngine->linksForIdentifier(m_helpId);
+ helpLinks = Core::HelpManager::instance()->linksForIdentifier(m_helpId);
break;
}
}
@@ -309,7 +287,7 @@ void CppHoverHandler::updateHelpIdAndTooltip(TextEditor::ITextEditor *editor, in
// To show their help anyway, try stripping scopes until we find something.
const QString startHelpId = m_helpId;
while (!m_helpId.isEmpty()) {
- helpLinks = m_helpEngine->linksForIdentifier(m_helpId);
+ helpLinks = Core::HelpManager::instance()->linksForIdentifier(m_helpId);
if (!helpLinks.isEmpty())
break;