summaryrefslogtreecommitdiff
path: root/src/plugins/android/javaeditor.cpp
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@theqtcompany.com>2016-05-30 15:23:52 +0200
committerEike Ziller <eike.ziller@qt.io>2016-05-31 07:31:29 +0000
commit79733e5625faa44e013b74d625b1eb9214378e36 (patch)
treefcf3f9d9376bb41f579cf82367f058352f3b1b36 /src/plugins/android/javaeditor.cpp
parent74558e856181f6b8885ad0590302f7193acf4912 (diff)
downloadqt-creator-79733e5625faa44e013b74d625b1eb9214378e36.tar.gz
Remove a few TextDocument subclasses
Which only differed in some property settings. Change-Id: Ie844c32709ebe719a5b749fd2ef828b64086ba9a Reviewed-by: hjk <hjk@theqtcompany.com> Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Diffstat (limited to 'src/plugins/android/javaeditor.cpp')
-rw-r--r--src/plugins/android/javaeditor.cpp23
1 files changed, 7 insertions, 16 deletions
diff --git a/src/plugins/android/javaeditor.cpp b/src/plugins/android/javaeditor.cpp
index 7398140922..6d52b5772c 100644
--- a/src/plugins/android/javaeditor.cpp
+++ b/src/plugins/android/javaeditor.cpp
@@ -44,22 +44,13 @@
namespace Android {
namespace Internal {
-//
-// JavaDocument
-//
-
-class JavaDocument : public TextEditor::TextDocument
+static TextEditor::TextDocument *createJavaDocument()
{
-public:
- JavaDocument();
-};
-
-
-JavaDocument::JavaDocument()
-{
- setId(Constants::JAVA_EDITOR_ID);
- setMimeType(QLatin1String(Constants::JAVA_MIMETYPE));
- setIndenter(new JavaIndenter);
+ auto doc = new TextEditor::TextDocument;
+ doc->setId(Constants::JAVA_EDITOR_ID);
+ doc->setMimeType(QLatin1String(Constants::JAVA_MIMETYPE));
+ doc->setIndenter(new JavaIndenter);
+ return doc;
}
//
@@ -72,7 +63,7 @@ JavaEditorFactory::JavaEditorFactory()
setDisplayName(tr("Java Editor"));
addMimeType(Constants::JAVA_MIMETYPE);
- setDocumentCreator([]() { return new JavaDocument; });
+ setDocumentCreator(createJavaDocument);
setUseGenericHighlighter(true);
setCommentStyle(Utils::CommentDefinition::CppStyle);
setEditorActionHandlers(TextEditor::TextEditorActionHandler::UnCommentSelection);