forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -35,10 +35,6 @@
|
||||
|
||||
#include <coreplugin/editormanager/ieditorfactory.h>
|
||||
|
||||
namespace TextEditor {
|
||||
class TextEditorActionHandler;
|
||||
}
|
||||
|
||||
namespace GenericProjectManager {
|
||||
namespace Internal {
|
||||
|
||||
@@ -52,12 +48,9 @@ class ProjectFilesFactory: public Core::IEditorFactory
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ProjectFilesFactory(Manager *manager, TextEditor::TextEditorActionHandler *handler);
|
||||
ProjectFilesFactory(Manager *manager);
|
||||
|
||||
Core::IEditor *createEditor(QWidget *parent);
|
||||
|
||||
private:
|
||||
TextEditor::TextEditorActionHandler *m_actionHandler;
|
||||
};
|
||||
|
||||
class ProjectFilesEditor : public TextEditor::BaseTextEditor
|
||||
@@ -77,16 +70,13 @@ class ProjectFilesEditorWidget : public TextEditor::BaseTextEditorWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ProjectFilesEditorWidget(QWidget *parent, ProjectFilesFactory *factory,
|
||||
TextEditor::TextEditorActionHandler *handler);
|
||||
ProjectFilesEditorWidget(QWidget *parent, ProjectFilesFactory *factory);
|
||||
|
||||
ProjectFilesFactory *factory() const;
|
||||
TextEditor::TextEditorActionHandler *actionHandler() const;
|
||||
TextEditor::BaseTextEditor *createEditor();
|
||||
|
||||
private:
|
||||
ProjectFilesFactory *m_factory;
|
||||
TextEditor::TextEditorActionHandler *m_actionHandler;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user