forked from qt-creator/qt-creator
core: make context and widget IContext data members
This commit is contained in:
@@ -55,17 +55,11 @@ using namespace CMakeProjectManager::Internal;
|
||||
//
|
||||
|
||||
CMakeEditor::CMakeEditor(CMakeEditorWidget *editor)
|
||||
: BaseTextEditor(editor),
|
||||
m_context(CMakeProjectManager::Constants::C_CMAKEEDITOR,
|
||||
TextEditor::Constants::C_TEXTEDITOR)
|
||||
: BaseTextEditor(editor)
|
||||
{
|
||||
connect (this, SIGNAL(changed()),
|
||||
this, SLOT(markAsChanged()));
|
||||
}
|
||||
|
||||
Core::Context CMakeEditor::context() const
|
||||
{
|
||||
return m_context;
|
||||
setContext(Core::Context(CMakeProjectManager::Constants::C_CMAKEEDITOR,
|
||||
TextEditor::Constants::C_TEXTEDITOR));
|
||||
connect(this, SIGNAL(changed()), this, SLOT(markAsChanged()));
|
||||
}
|
||||
|
||||
Core::IEditor *CMakeEditor::duplicate(QWidget *parent)
|
||||
@@ -122,10 +116,6 @@ CMakeEditorWidget::CMakeEditorWidget(QWidget *parent, CMakeEditorFactory *factor
|
||||
baseTextDocument()->setSyntaxHighlighter(new CMakeHighlighter);
|
||||
}
|
||||
|
||||
CMakeEditorWidget::~CMakeEditorWidget()
|
||||
{
|
||||
}
|
||||
|
||||
TextEditor::BaseTextEditor *CMakeEditorWidget::createEditor()
|
||||
{
|
||||
return new CMakeEditor(this);
|
||||
|
||||
@@ -54,19 +54,18 @@ class CMakeManager;
|
||||
class CMakeEditor : public TextEditor::BaseTextEditor
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CMakeEditor(CMakeEditorWidget *);
|
||||
Core::Context context() const;
|
||||
|
||||
bool duplicateSupported() const { return true; }
|
||||
Core::IEditor *duplicate(QWidget *parent);
|
||||
QString id() const;
|
||||
bool isTemporary() const { return false; }
|
||||
|
||||
private slots:
|
||||
void markAsChanged();
|
||||
void build();
|
||||
private:
|
||||
const Core::Context m_context;
|
||||
};
|
||||
|
||||
class CMakeEditorWidget : public TextEditor::BaseTextEditorWidget
|
||||
@@ -75,7 +74,6 @@ class CMakeEditorWidget : public TextEditor::BaseTextEditorWidget
|
||||
|
||||
public:
|
||||
CMakeEditorWidget(QWidget *parent, CMakeEditorFactory *factory, TextEditor::TextEditorActionHandler *ah);
|
||||
~CMakeEditorWidget();
|
||||
|
||||
bool save(const QString &fileName = QString());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user