aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/basehoverhandler.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2017-06-19 12:17:59 +0200
committerNikolai Kosjar <nikolai.kosjar@qt.io>2017-06-29 08:01:35 +0000
commit50790f61872b4b2fadf103f946561406b6732318 (patch)
tree969830b535e0bbfb7072dfa9e4fac9044c9fc7b7 /src/plugins/texteditor/basehoverhandler.cpp
parenta7e8406ced48818682e52ca208af94c18c8c837e (diff)
TextEditor: Avoid unneeded calls in BaseHoverHandler
In checkToolTip(), the call to decorateToolTip() is not needed since it does not affect the priority. In showToolTip(), we can assume that checkToolTip() was called and thus avoid a call to identifyMatch(). TextEditorWidgetPrivate::processTooltipRequest() is the only caller of checkToolTip() and showToolTip(). Change-Id: I362c697754b6a29c9c0b34f85d3022f00e3e1031 Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/texteditor/basehoverhandler.cpp')
-rw-r--r--src/plugins/texteditor/basehoverhandler.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/plugins/texteditor/basehoverhandler.cpp b/src/plugins/texteditor/basehoverhandler.cpp
index 7764f12dbd..abbf2154ab 100644
--- a/src/plugins/texteditor/basehoverhandler.cpp
+++ b/src/plugins/texteditor/basehoverhandler.cpp
@@ -33,11 +33,9 @@ namespace TextEditor {
BaseHoverHandler::~BaseHoverHandler()
{}
-void BaseHoverHandler::showToolTip(TextEditorWidget *widget, const QPoint &point, int pos)
+void BaseHoverHandler::showToolTip(TextEditorWidget *widget, const QPoint &point)
{
- widget->setContextHelpId(QString());
-
- process(widget, pos);
+ decorateToolTip();
operateTooltip(widget, point);
}
@@ -101,18 +99,13 @@ const HelpItem &BaseHoverHandler::lastHelpItemIdentified() const
return m_lastHelpItemIdentified;
}
-void BaseHoverHandler::clear()
+void BaseHoverHandler::process(TextEditorWidget *widget, int pos)
{
m_toolTip.clear();
m_priority = -1;
m_lastHelpItemIdentified = HelpItem();
-}
-void BaseHoverHandler::process(TextEditorWidget *widget, int pos)
-{
- clear();
identifyMatch(widget, pos);
- decorateToolTip();
}
void BaseHoverHandler::identifyMatch(TextEditorWidget *editorWidget, int pos)