From 2e17339b05028dee540cc6da6a481229e98224be Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 3 Sep 2014 13:10:57 +0200 Subject: TextEditor: Reset mimetype after open() in all BaseTextEditors This was already done in all major editors and should not harm all others. Change-Id: I7e19d285c4b85419a9a1f9afa961addecf682eaf Reviewed-by: Eike Ziller --- src/plugins/pythoneditor/pythoneditor.cpp | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'src/plugins/pythoneditor/pythoneditor.cpp') diff --git a/src/plugins/pythoneditor/pythoneditor.cpp b/src/plugins/pythoneditor/pythoneditor.cpp index 683de096a2..d7423df5f1 100644 --- a/src/plugins/pythoneditor/pythoneditor.cpp +++ b/src/plugins/pythoneditor/pythoneditor.cpp @@ -33,46 +33,17 @@ #include "tools/pythonindenter.h" #include "tools/pythonhighlighter.h" -#include -#include -#include - #include -#include #include #include -#include -#include #include -#include - using namespace TextEditor; namespace PythonEditor { namespace Internal { -// -// PythonEditor -// - -class PythonEditor : public BaseTextEditor -{ -public: - PythonEditor() - { - } - - bool open(QString *errorString, const QString &fileName, const QString &realFileName) - { - Core::MimeType mimeType = Core::MimeDatabase::findByFile(QFileInfo(fileName)); - textDocument()->setMimeType(mimeType.type()); - return BaseTextEditor::open(errorString, fileName, realFileName); - } -}; - - // // PythonEditorWidget // @@ -105,7 +76,6 @@ PythonEditorFactory::PythonEditorFactory() setDocumentCreator([]() { return new BaseTextDocument(Constants::C_PYTHONEDITOR_ID); }); setEditorWidgetCreator([]() { return new PythonEditorWidget; }); - setEditorCreator([]() { return new PythonEditor; }); setIndenterCreator([]() { return new PythonIndenter; }); setSyntaxHighlighterCreator([]() { return new PythonHighlighter; }); setCommentStyle(Utils::CommentDefinition::HashStyle); -- cgit v1.2.1