forked from qt-creator/qt-creator
core: make context and widget IContext data members
This commit is contained in:
@@ -42,13 +42,11 @@
|
||||
|
||||
using namespace TextEditor;
|
||||
|
||||
SnippetEditor::SnippetEditor(SnippetEditorWidget *editor) :
|
||||
BaseTextEditor(editor),
|
||||
m_context(Constants::SNIPPET_EDITOR_ID, Constants::C_TEXTEDITOR)
|
||||
{}
|
||||
|
||||
SnippetEditor::~SnippetEditor()
|
||||
{}
|
||||
SnippetEditor::SnippetEditor(SnippetEditorWidget *editor)
|
||||
: BaseTextEditor(editor)
|
||||
{
|
||||
setContext(Core::Context(Constants::SNIPPET_EDITOR_ID, Constants::C_TEXTEDITOR));
|
||||
}
|
||||
|
||||
QString SnippetEditor::id() const
|
||||
{
|
||||
@@ -63,9 +61,6 @@ SnippetEditorWidget::SnippetEditorWidget(QWidget *parent) : BaseTextEditorWidget
|
||||
setParenthesesMatchingEnabled(true);
|
||||
}
|
||||
|
||||
SnippetEditorWidget::~SnippetEditorWidget()
|
||||
{}
|
||||
|
||||
void SnippetEditorWidget::setSyntaxHighlighter(TextEditor::SyntaxHighlighter *highlighter)
|
||||
{
|
||||
baseTextDocument()->setSyntaxHighlighter(highlighter);
|
||||
|
||||
@@ -55,17 +55,11 @@ class TEXTEDITOR_EXPORT SnippetEditor : public BaseTextEditor
|
||||
|
||||
public:
|
||||
SnippetEditor(SnippetEditorWidget *editorWidget);
|
||||
virtual ~SnippetEditor();
|
||||
|
||||
Core::Context context() const { return m_context; }
|
||||
|
||||
bool duplicateSupported() const { return false; }
|
||||
Core::IEditor *duplicate(QWidget * /* parent */ ) { return 0; }
|
||||
bool isTemporary() const { return false; }
|
||||
virtual QString id() const;
|
||||
|
||||
private:
|
||||
const Core::Context m_context;
|
||||
};
|
||||
|
||||
class TEXTEDITOR_EXPORT SnippetEditorWidget : public BaseTextEditorWidget
|
||||
@@ -74,7 +68,6 @@ class TEXTEDITOR_EXPORT SnippetEditorWidget : public BaseTextEditorWidget
|
||||
|
||||
public:
|
||||
SnippetEditorWidget(QWidget *parent);
|
||||
virtual ~SnippetEditorWidget();
|
||||
|
||||
void setSyntaxHighlighter(SyntaxHighlighter *highlighter);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user