PythonEditor: Modernize/Streamline

Remove virtual, add override, add = delete, remove QLatin1*,
flatten filesystem hierarchy, remove unneeded 'inline',
use initializer list, etc.

Change-Id: I0a95d806d73ca1a33cfd1ba85c2664d9ebc32690
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2016-08-03 00:07:44 +02:00
committed by hjk
parent edb0da7552
commit 56a098598f
14 changed files with 239 additions and 497 deletions

View File

@@ -26,8 +26,8 @@
#include "pythoneditor.h"
#include "pythoneditorconstants.h"
#include "pythoneditorplugin.h"
#include "tools/pythonindenter.h"
#include "tools/pythonhighlighter.h"
#include "pythonindenter.h"
#include "pythonhighlighter.h"
#include <texteditor/texteditoractionhandler.h>
#include <texteditor/texteditorconstants.h>
@@ -44,15 +44,15 @@ PythonEditorFactory::PythonEditorFactory()
{
setId(Constants::C_PYTHONEDITOR_ID);
setDisplayName(QCoreApplication::translate("OpenWith::Editors", Constants::C_EDITOR_DISPLAY_NAME));
addMimeType(QLatin1String(Constants::C_PY_MIMETYPE));
addMimeType(Constants::C_PY_MIMETYPE);
setEditorActionHandlers(TextEditorActionHandler::Format
| TextEditorActionHandler::UnCommentSelection
| TextEditorActionHandler::UnCollapseAll);
setDocumentCreator([]() { return new TextDocument(Constants::C_PYTHONEDITOR_ID); });
setIndenterCreator([]() { return new PythonIndenter; });
setSyntaxHighlighterCreator([]() { return new PythonHighlighter; });
setDocumentCreator([] { return new TextDocument(Constants::C_PYTHONEDITOR_ID); });
setIndenterCreator([] { return new PythonIndenter; });
setSyntaxHighlighterCreator([] { return new PythonHighlighter; });
setCommentStyle(Utils::CommentDefinition::HashStyle);
setParenthesesMatchingEnabled(true);
setMarksVisible(true);