mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-07-19 05:24:59 -04:00
refactor: Make connection more async (#182)
This commit is contained in:
@ -38,7 +38,6 @@ namespace QodeAssist {
|
||||
void CompletionProgressHandler::showProgress(TextEditor::TextEditorWidget *widget)
|
||||
{
|
||||
m_widget = widget;
|
||||
m_isActive = true;
|
||||
|
||||
if (m_widget) {
|
||||
const QRect cursorRect = m_widget->cursorRect(m_widget->textCursor());
|
||||
@ -54,14 +53,13 @@ void CompletionProgressHandler::showProgress(TextEditor::TextEditorWidget *widge
|
||||
|
||||
void CompletionProgressHandler::hideProgress()
|
||||
{
|
||||
m_isActive = false;
|
||||
Utils::ToolTip::hide();
|
||||
Utils::ToolTip::hideImmediately();
|
||||
}
|
||||
|
||||
void CompletionProgressHandler::identifyMatch(
|
||||
TextEditor::TextEditorWidget *editorWidget, int pos, ReportPriority report)
|
||||
{
|
||||
if (!m_isActive || !editorWidget) {
|
||||
if (!editorWidget) {
|
||||
report(Priority_None);
|
||||
return;
|
||||
}
|
||||
@ -72,7 +70,7 @@ void CompletionProgressHandler::identifyMatch(
|
||||
void CompletionProgressHandler::operateTooltip(
|
||||
TextEditor::TextEditorWidget *editorWidget, const QPoint &point)
|
||||
{
|
||||
if (!m_isActive || !editorWidget)
|
||||
if (!editorWidget)
|
||||
return;
|
||||
|
||||
auto progressWidget = new ProgressWidget(editorWidget);
|
||||
|
@ -38,7 +38,6 @@ protected:
|
||||
private:
|
||||
QPointer<TextEditor::TextEditorWidget> m_widget;
|
||||
QPoint m_iconPosition;
|
||||
bool m_isActive = false;
|
||||
};
|
||||
|
||||
} // namespace QodeAssist
|
||||
|
Reference in New Issue
Block a user