forked from qt-creator/qt-creator
Help: Avoid double lookup for help tooltips
Save the HelpItem directly in the tooltip instead of the help ID which would need to be looked up again. Change-Id: I107e82e89d9ea26cad9d6532ad4c687d1ac8f1ec Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -647,12 +647,15 @@ static QUrl findBestLink(const QMap<QString, QUrl> &links)
|
||||
void HelpPluginPrivate::requestContextHelp()
|
||||
{
|
||||
// Find out what to show
|
||||
QString contextHelpId = Utils::ToolTip::contextHelpId();
|
||||
const QVariant tipHelpValue = Utils::ToolTip::contextHelp();
|
||||
const HelpItem tipHelp = tipHelpValue.canConvert<HelpItem>()
|
||||
? tipHelpValue.value<HelpItem>()
|
||||
: HelpItem(tipHelpValue.toString());
|
||||
IContext *context = ICore::currentContextObject();
|
||||
if (contextHelpId.isEmpty() && context)
|
||||
if (!tipHelp.isValid() && context)
|
||||
context->contextHelp([this](const HelpItem &item) { showContextHelp(item); });
|
||||
else
|
||||
showContextHelp(contextHelpId);
|
||||
showContextHelp(tipHelp);
|
||||
}
|
||||
|
||||
void HelpPluginPrivate::showContextHelp(const HelpItem &contextHelp)
|
||||
|
||||
Reference in New Issue
Block a user