diff options
author | Eike Ziller <eike.ziller@digia.com> | 2013-12-10 15:54:20 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2013-12-12 09:59:27 +0100 |
commit | 3d1b70c58e0d2eea47572ec4a018a18674508f9b (patch) | |
tree | 2217255fb7d6bc8e3e30603bb985cb655ab7be7d /src/plugins/cmakeprojectmanager | |
parent | 3ee9fb4d1c74058c785f24d19bac5fe879c75109 (diff) | |
download | qt-creator-3d1b70c58e0d2eea47572ec4a018a18674508f9b.tar.gz |
Remove the need to register editors in the action handler
The action handler already knows which editors to handle through the
context. It only needs to receive signals for updating the actions from
the current editor. So there is no need to tell the action handler about
every individual editor. This also removes some noise from the text
editor implementations.
Change-Id: I76dc5b1559cc8cf54ff313e6cdba4e789a3108aa
Reviewed-by: David Schulz <david.schulz@digia.com>
Diffstat (limited to 'src/plugins/cmakeprojectmanager')
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakeeditor.cpp | 8 | ||||
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakeeditor.h | 4 | ||||
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp | 2 |
3 files changed, 5 insertions, 9 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 3ae4a1e730..05c71707d6 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -68,7 +68,7 @@ CMakeEditor::CMakeEditor(CMakeEditorWidget *editor) Core::IEditor *CMakeEditor::duplicate(QWidget *parent) { CMakeEditorWidget *w = qobject_cast<CMakeEditorWidget*>(widget()); - CMakeEditorWidget *ret = new CMakeEditorWidget(parent, w->factory(), w->actionHandler()); + CMakeEditorWidget *ret = new CMakeEditorWidget(parent, w->factory()); ret->duplicateFrom(w); TextEditor::TextEditorSettings::initializeEditor(ret); return ret->editor(); @@ -116,8 +116,8 @@ void CMakeEditor::build() // CMakeEditor // -CMakeEditorWidget::CMakeEditorWidget(QWidget *parent, CMakeEditorFactory *factory, TextEditor::TextEditorActionHandler *ah) - : BaseTextEditorWidget(parent), m_factory(factory), m_ah(ah) +CMakeEditorWidget::CMakeEditorWidget(QWidget *parent, CMakeEditorFactory *factory) + : BaseTextEditorWidget(parent), m_factory(factory) { QSharedPointer<CMakeDocument> doc(new CMakeDocument); doc->setMimeType(QLatin1String(CMakeProjectManager::Constants::CMAKEMIMETYPE)); @@ -127,8 +127,6 @@ CMakeEditorWidget::CMakeEditorWidget(QWidget *parent, CMakeEditorFactory *factor m_commentDefinition.clearCommentStyles(); m_commentDefinition.singleLine = QLatin1Char('#'); - - ah->setupActions(this); } TextEditor::BaseTextEditor *CMakeEditorWidget::createEditor() diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.h b/src/plugins/cmakeprojectmanager/cmakeeditor.h index 55e7639a24..8f6f6a1f1d 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.h +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.h @@ -71,12 +71,11 @@ class CMakeEditorWidget : public TextEditor::BaseTextEditorWidget Q_OBJECT public: - CMakeEditorWidget(QWidget *parent, CMakeEditorFactory *factory, TextEditor::TextEditorActionHandler *ah); + CMakeEditorWidget(QWidget *parent, CMakeEditorFactory *factory); bool save(const QString &fileName = QString()); CMakeEditorFactory *factory() { return m_factory; } - TextEditor::TextEditorActionHandler *actionHandler() const { return m_ah; } Link findLinkAt(const QTextCursor &cursor, bool resolveTarget = true, bool inNextSplit = false); @@ -89,7 +88,6 @@ public slots: private: CMakeEditorFactory *m_factory; - TextEditor::TextEditorActionHandler *m_ah; Utils::CommentDefinition m_commentDefinition; }; diff --git a/src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp b/src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp index 7b7b32ae5a..629518f08a 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp @@ -72,7 +72,7 @@ CMakeEditorFactory::CMakeEditorFactory(CMakeManager *manager) Core::IEditor *CMakeEditorFactory::createEditor(QWidget *parent) { - CMakeEditorWidget *rc = new CMakeEditorWidget(parent, this, m_actionHandler); + CMakeEditorWidget *rc = new CMakeEditorWidget(parent, this); TextEditor::TextEditorSettings::initializeEditor(rc); return rc->editor(); } |