diff options
author | Eike Ziller <eike.ziller@qt.io> | 2019-01-25 15:04:50 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2019-01-29 07:57:19 +0000 |
commit | 418dcfbcbbd15a63ed261b22da3391e43e7ab8aa (patch) | |
tree | 7b176df3b7b48527fdb53d1caaa964de63800607 /src/plugins/texteditor/basehoverhandler.cpp | |
parent | c04c5c1575e4ee425e6d2383e52a2b44e9c20fd2 (diff) |
Help: Avoid multiple lookups of help id for context help
Context help would first query the database with potential IDs, and
afterwards the help plugin would look up the links for the resulting ID
again.
Pass the HelpItem (which potentially contains the cached links) directly
to context help.
Change-Id: I73bddcd3cd4eacaea412b98d53c5e5354a31f3d5
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/texteditor/basehoverhandler.cpp')
-rw-r--r-- | src/plugins/texteditor/basehoverhandler.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/plugins/texteditor/basehoverhandler.cpp b/src/plugins/texteditor/basehoverhandler.cpp index 19ab9073e9c..6529ab9d39b 100644 --- a/src/plugins/texteditor/basehoverhandler.cpp +++ b/src/plugins/texteditor/basehoverhandler.cpp @@ -45,7 +45,7 @@ void BaseHoverHandler::checkPriority(TextEditorWidget *widget, int pos, ReportPriority report) { - widget->setContextHelpId(QString()); + widget->setContextHelpItem({}); process(widget, pos, report); } @@ -117,12 +117,9 @@ bool BaseHoverHandler::isContextHelpRequest() const void BaseHoverHandler::propagateHelpId(TextEditorWidget *widget, const Core::IContext::HelpIdCallback &callback) { - QString id; - if (lastHelpItemIdentified().isValid()) - id = lastHelpItemIdentified().helpId(); - - widget->setContextHelpId(id); - callback(id); + const Core::HelpItem contextHelp = lastHelpItemIdentified(); + widget->setContextHelpItem(contextHelp); + callback(contextHelp); } void BaseHoverHandler::process(TextEditorWidget *widget, int pos, ReportPriority report) |