Commit 3e7d9bde authored by hjk's avatar hjk
Browse files

texteditor: directly call completion instead using ITextEditor interface

Reviewed-By: con
parent e81e7324
......@@ -538,16 +538,6 @@ void BaseTextEditorWidget::selectEncoding()
}
}
void BaseTextEditorWidget::triggerCompletions()
{
CompletionSupport::instance()->complete(editor(), SemanticCompletion, true);
}
void BaseTextEditorWidget::triggerQuickFix()
{
CompletionSupport::instance()->complete(editor(), QuickFixCompletion, true);
}
QString BaseTextEditorWidget::msgTextTooLarge(quint64 size)
{
return tr("The text is too large to be displayed (%1 MB).").
......
......@@ -155,9 +155,6 @@ public:
BaseTextEditor *editor() const;
ITextMarkable *markableInterface() const;
virtual void triggerCompletions();
virtual void triggerQuickFix();
QChar characterAt(int pos) const;
void print(QPrinter *);
......@@ -584,9 +581,6 @@ public:
QString textAt(int pos, int length) const;
inline QChar characterAt(int pos) const { return e->characterAt(pos); }
inline void triggerCompletions() { e->triggerCompletions(); } // slot?
inline void triggerQuickFix() { e->triggerQuickFix(); } // slot?
inline ITextMarkable *markableInterface() { return e->markableInterface(); }
void setContextHelpId(const QString &id) { m_contextHelpId = id; }
......
......@@ -125,9 +125,6 @@ public:
/*! Selects text between current cursor position and \a toPos. */
virtual void select(int toPos) = 0;
virtual void triggerCompletions() = 0;
virtual void triggerQuickFix() = 0;
virtual ITextMarkable *markableInterface() = 0;
virtual void setContextHelpId(const QString &) = 0;
......
......@@ -33,6 +33,7 @@
#include "texteditorplugin.h"
#include "completionsupport.h"
#include "findinfiles.h"
#include "findincurrentfile.h"
#include "fontsettings.h"
......@@ -217,7 +218,7 @@ void TextEditorPlugin::invokeCompletion()
Core::IEditor *iface = Core::EditorManager::instance()->currentEditor();
ITextEditor *editor = qobject_cast<ITextEditor *>(iface);
if (editor)
editor->triggerCompletions();
CompletionSupport::instance()->complete(editor, SemanticCompletion, true);
}
void TextEditorPlugin::invokeQuickFix()
......@@ -225,7 +226,7 @@ void TextEditorPlugin::invokeQuickFix()
Core::IEditor *iface = Core::EditorManager::instance()->currentEditor();
ITextEditor *editor = qobject_cast<ITextEditor *>(iface);
if (editor)
editor->triggerQuickFix();
CompletionSupport::instance()->complete(editor, QuickFixCompletion, true);
}
void TextEditorPlugin::updateSearchResultsFont(const FontSettings &settings)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment