summaryrefslogtreecommitdiff
path: root/src/plugins/genericprojectmanager
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2014-08-22 17:48:07 +0200
committerhjk <hjk121@nokiamail.com>2014-08-25 13:14:36 +0200
commitb11f5c2290ec369da8d52fcfa0eb4db62c7d7ba2 (patch)
treec305e7e52b134f203f316c1ab7581bfb0c9b312f /src/plugins/genericprojectmanager
parent89bd4ee3c4e4be4b39dee9ef12e798d21be3d2cb (diff)
downloadqt-creator-b11f5c2290ec369da8d52fcfa0eb4db62c7d7ba2.tar.gz
GenericProjectManager: Use BaseTextEditorFactory for creation
Change-Id: I7d932266ed9e139f9e22fd0bc84761a0430b0a95 Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Diffstat (limited to 'src/plugins/genericprojectmanager')
-rw-r--r--src/plugins/genericprojectmanager/genericprojectfileseditor.cpp35
-rw-r--r--src/plugins/genericprojectmanager/genericprojectfileseditor.h12
2 files changed, 16 insertions, 31 deletions
diff --git a/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp b/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp
index a306458dae..93742a848e 100644
--- a/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp
+++ b/src/plugins/genericprojectmanager/genericprojectfileseditor.cpp
@@ -41,11 +41,23 @@ using namespace TextEditor;
namespace GenericProjectManager {
namespace Internal {
-////////////////////////////////////////////////////////////////////////////////////////
+//
+// ProjectFilesEditor
+//
+
+class ProjectFilesEditor : public BaseTextEditor
+{
+public:
+ ProjectFilesEditor()
+ {
+ addContext(Constants::C_FILESEDITOR);
+ setDuplicateSupported(true);
+ }
+};
+
//
// ProjectFilesFactory
//
-////////////////////////////////////////////////////////////////////////////////////////
ProjectFilesFactory::ProjectFilesFactory()
{
@@ -54,27 +66,10 @@ ProjectFilesFactory::ProjectFilesFactory()
addMimeType(Constants::FILES_MIMETYPE);
addMimeType(Constants::INCLUDES_MIMETYPE);
addMimeType(Constants::CONFIG_MIMETYPE);
- new TextEditor::TextEditorActionHandler(this, Constants::C_FILESEDITOR);
-}
-Core::IEditor *ProjectFilesFactory::createEditor()
-{
- return new ProjectFilesEditor;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////
-//
-// ProjectFilesEditor
-//
-////////////////////////////////////////////////////////////////////////////////////////
-
-ProjectFilesEditor::ProjectFilesEditor()
-{
- addContext(Constants::C_FILESEDITOR);
- setDuplicateSupported(true);
setEditorCreator([]() { return new ProjectFilesEditor; });
- setWidgetCreator([]() { return new BaseTextEditorWidget; });
setDocumentCreator([]() { return new BaseTextDocument(Constants::FILES_EDITOR_ID); });
+ setEditorActionHandlers(Constants::C_FILESEDITOR, TextEditorActionHandler::None);
}
} // namespace Internal
diff --git a/src/plugins/genericprojectmanager/genericprojectfileseditor.h b/src/plugins/genericprojectmanager/genericprojectfileseditor.h
index 190904f083..9c98a03ae9 100644
--- a/src/plugins/genericprojectmanager/genericprojectfileseditor.h
+++ b/src/plugins/genericprojectmanager/genericprojectfileseditor.h
@@ -32,23 +32,13 @@
#include <texteditor/basetexteditor.h>
-#include <coreplugin/editormanager/ieditorfactory.h>
-
namespace GenericProjectManager {
namespace Internal {
-class ProjectFilesFactory: public Core::IEditorFactory
+class ProjectFilesFactory : public TextEditor::BaseTextEditorFactory
{
public:
ProjectFilesFactory();
-
- Core::IEditor *createEditor();
-};
-
-class ProjectFilesEditor : public TextEditor::BaseTextEditor
-{
-public:
- ProjectFilesEditor();
};
} // namespace Internal