QmlDesigner: Share contextHelpId

Moved the code to AbstractView::contextHelpId so it can be shared.

Change-Id: I0a95b5ee079cbc26c87d53587f7766f1c333a245
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
This commit is contained in:
Marco Bubke
2014-05-13 17:53:04 +02:00
parent 5794ad016d
commit dd6fb08bab
5 changed files with 24 additions and 31 deletions

View File

@@ -674,17 +674,10 @@ void DesignDocument::updateActiveQtVersion()
QString DesignDocument::contextHelpId() const
{
DesignDocumentView view;
currentModel()->attachView(&view);
if (view())
view()->contextHelpId();
QList<ModelNode> nodes = view.selectedModelNodes();
QString helpId;
if (!nodes.isEmpty()) {
helpId = nodes.first().type();
helpId.replace("QtQuick", "QML");
}
return helpId;
return QString();
}
} // namespace QmlDesigner