forked from qt-creator/qt-creator
TextEditor: Return hover handler priority by callback
...to get rid of the asynchronous code path. Change-Id: I56377510440631b0be712333b2a4018717c86389 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -102,17 +102,16 @@ static QFuture<CppTools::ToolTipInfo> editorDocumentHandlesToolTipInfo(
|
||||
|
||||
ClangHoverHandler::ClangHoverHandler()
|
||||
{
|
||||
setIsAsyncHandler(true);
|
||||
}
|
||||
|
||||
ClangHoverHandler::~ClangHoverHandler()
|
||||
{
|
||||
cancelAsyncCheck();
|
||||
abort();
|
||||
}
|
||||
|
||||
void ClangHoverHandler::identifyMatchAsync(TextEditorWidget *editorWidget,
|
||||
int pos,
|
||||
BaseHoverHandler::ReportPriority report)
|
||||
void ClangHoverHandler::identifyMatch(TextEditorWidget *editorWidget,
|
||||
int pos,
|
||||
BaseHoverHandler::ReportPriority report)
|
||||
{
|
||||
// Reset
|
||||
m_futureWatcher.reset();
|
||||
@@ -143,7 +142,7 @@ void ClangHoverHandler::identifyMatchAsync(TextEditorWidget *editorWidget,
|
||||
report(Priority_None); // Ops, something went wrong.
|
||||
}
|
||||
|
||||
void ClangHoverHandler::cancelAsyncCheck()
|
||||
void ClangHoverHandler::abort()
|
||||
{
|
||||
if (m_futureWatcher)
|
||||
m_futureWatcher->cancel();
|
||||
|
||||
Reference in New Issue
Block a user