diff --git a/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp b/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp index 6369ff94ad5..45142a21591 100644 --- a/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp +++ b/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include using namespace GenericProjectManager; @@ -12,7 +13,7 @@ using namespace GenericProjectManager::Internal; //////////////////////////////////////////////////////////////////////////////////////// -// ProjectFilesEditable +// ProjectFilesFactory //////////////////////////////////////////////////////////////////////////////////////// ProjectFilesFactory::ProjectFilesFactory(Manager *manager, @@ -114,6 +115,8 @@ ProjectFilesEditor::ProjectFilesEditor(QWidget *parent, ProjectFilesFactory *fac Manager *manager = factory->manager(); ProjectFilesDocument *doc = new ProjectFilesDocument(manager); setBaseTextDocument(doc); + + handler->setupActions(this); } ProjectFilesEditor::~ProjectFilesEditor() diff --git a/src/plugins/qt4projectmanager/profileeditor.cpp b/src/plugins/qt4projectmanager/profileeditor.cpp index e2ec8ce12d1..567e14f2e25 100644 --- a/src/plugins/qt4projectmanager/profileeditor.cpp +++ b/src/plugins/qt4projectmanager/profileeditor.cpp @@ -33,8 +33,6 @@ #include "qt4projectmanager.h" #include "qt4projectmanagerconstants.h" #include "profileeditorfactory.h" -#include "proeditormodel.h" -#include "procommandmanager.h" #include #include @@ -42,17 +40,14 @@ #include #include -#include #include -#include -#include -using namespace ExtensionSystem; -using namespace Core; using namespace Qt4ProjectManager; using namespace Qt4ProjectManager::Internal; -using namespace ProjectExplorer; +// +// ProFileEditorEditable +// ProFileEditorEditable::ProFileEditorEditable(ProFileEditor *editor) : BaseTextEditorEditable(editor) @@ -63,11 +58,29 @@ ProFileEditorEditable::ProFileEditorEditable(ProFileEditor *editor) // m_contexts << uidm->uniqueIdentifier(Qt4ProjectManager::Constants::PROJECT_KIND); } -TextEditor::BaseTextEditorEditable *ProFileEditor::createEditableInterface() +QList ProFileEditorEditable::context() const { - return new ProFileEditorEditable(this); + return m_context; } +Core::IEditor *ProFileEditorEditable::duplicate(QWidget *parent) +{ + ProFileEditor *ret = new ProFileEditor(parent, qobject_cast(editor())->factory(), + qobject_cast(editor())->actionHandler()); + ret->duplicateFrom(editor()); + ret->initialize(); + return ret->editableInterface(); +} + +const char *ProFileEditorEditable::kind() const +{ + return Qt4ProjectManager::Constants::PROFILE_EDITOR; +} + +// +// ProFileEditorEditor +// + ProFileEditor::ProFileEditor(QWidget *parent, ProFileEditorFactory *factory, TextEditor::TextEditorActionHandler *ah) : BaseTextEditor(parent), m_factory(factory), m_ah(ah) { @@ -85,18 +98,9 @@ ProFileEditor::~ProFileEditor() { } -QList ProFileEditorEditable::context() const +TextEditor::BaseTextEditorEditable *ProFileEditor::createEditableInterface() { - return m_context; -} - -Core::IEditor *ProFileEditorEditable::duplicate(QWidget *parent) -{ - ProFileEditor *ret = new ProFileEditor(parent, qobject_cast(editor())->factory(), - qobject_cast(editor())->actionHandler()); - ret->duplicateFrom(editor()); - ret->initialize(); - return ret->editableInterface(); + return new ProFileEditorEditable(this); } void ProFileEditor::initialize() @@ -109,11 +113,6 @@ void ProFileEditor::initialize() setFontSettings(settings->fontSettings()); } -const char *ProFileEditorEditable::kind() const -{ - return Qt4ProjectManager::Constants::PROFILE_EDITOR; -} - void ProFileEditor::setFontSettings(const TextEditor::FontSettings &fs) { TextEditor::BaseTextEditor::setFontSettings(fs); @@ -133,6 +132,10 @@ void ProFileEditor::setFontSettings(const TextEditor::FontSettings &fs) highlighter->rehighlight(); } +// +// ProFileDocument +// + ProFileDocument::ProFileDocument(Qt4Manager *manager) : TextEditor::BaseTextDocument(), m_manager(manager) {