forked from qt-creator/qt-creator
TextEditor: Re-work comment definition handling
No need for most of the machinery. Change-Id: I9078174582d83da94c6c7f20282fd3a5f1742911 Reviewed-by: Christian Stenger <christian.stenger@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -62,6 +62,7 @@ CMakeEditor::CMakeEditor(CMakeEditorWidget *editor)
|
||||
setContext(Core::Context(CMakeProjectManager::Constants::C_CMAKEEDITOR,
|
||||
TextEditor::Constants::C_TEXTEDITOR));
|
||||
setDuplicateSupported(true);
|
||||
setCommentStyle(Utils::CommentDefinition::HashStyle);
|
||||
connect(document(), SIGNAL(changed()), this, SLOT(markAsChanged()));
|
||||
}
|
||||
|
||||
@@ -154,32 +155,17 @@ QString CMakeEditor::contextHelpId() const
|
||||
|
||||
CMakeEditorWidget::CMakeEditorWidget(QWidget *parent)
|
||||
: BaseTextEditorWidget(new CMakeDocument(), parent)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
{}
|
||||
|
||||
CMakeEditorWidget::CMakeEditorWidget(CMakeEditorWidget *other)
|
||||
: BaseTextEditorWidget(other)
|
||||
{
|
||||
ctor();
|
||||
}
|
||||
|
||||
void CMakeEditorWidget::ctor()
|
||||
{
|
||||
m_commentDefinition.clearCommentStyles();
|
||||
m_commentDefinition.singleLine = QLatin1Char('#');
|
||||
}
|
||||
{}
|
||||
|
||||
TextEditor::BaseTextEditor *CMakeEditorWidget::createEditor()
|
||||
{
|
||||
return new CMakeEditor(this);
|
||||
}
|
||||
|
||||
void CMakeEditorWidget::unCommentSelection()
|
||||
{
|
||||
Utils::unCommentSelection(this, m_commentDefinition);
|
||||
}
|
||||
|
||||
void CMakeEditorWidget::contextMenuEvent(QContextMenuEvent *e)
|
||||
{
|
||||
showDefaultContextMenu(e, Constants::M_CONTEXT);
|
||||
|
||||
Reference in New Issue
Block a user