CppEditor: Simplify handling of comment splitting

Change-Id: I9a6e4962b52321313bb80cc3c3a77fac80aa0536
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
hjk
2014-10-15 09:24:09 +02:00
parent 96af4e3c8e
commit 0e53554dfb
3 changed files with 67 additions and 114 deletions

View File

@@ -110,8 +110,6 @@ public:
CppEditorDocument *m_cppEditorDocument;
CppEditorOutline *m_cppEditorOutline;
CppDocumentationCommentHelper m_cppDocumentationCommentHelper;
QTimer m_updateFunctionDeclDefLinkTimer;
CppLocalRenaming m_localRenaming;
@@ -132,7 +130,6 @@ CppEditorWidgetPrivate::CppEditorWidgetPrivate(CppEditorWidget *q)
: m_modelManager(CppModelManager::instance())
, m_cppEditorDocument(qobject_cast<CppEditorDocument *>(q->textDocument()))
, m_cppEditorOutline(new CppEditorOutline(q))
, m_cppDocumentationCommentHelper(q)
, m_localRenaming(q)
, m_useSelectionsUpdater(q)
, m_declDefLinkFinder(new FunctionDeclDefLinkFinder(q))
@@ -541,8 +538,12 @@ void CppEditorWidget::keyPressEvent(QKeyEvent *e)
if (handleStringSplitting(e))
return;
if (d->m_cppDocumentationCommentHelper.handleKeyPressEvent(e))
return;
if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) {
if (trySplitComment(this)) {
e->accept();
return;
}
}
TextEditorWidget::keyPressEvent(e);
}