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 <eike.ziller@digia.com>
This commit is contained in:
hjk
2014-09-03 13:10:57 +02:00
parent 480efb0254
commit 2e17339b05
7 changed files with 4 additions and 74 deletions

View File

@@ -47,7 +47,6 @@
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/icore.h>
#include <coreplugin/id.h>
#include <coreplugin/mimedatabase.h>
#include <extensionsystem/pluginmanager.h>
#include <extensionsystem/pluginspec.h>
@@ -326,26 +325,6 @@ IAssistInterface *GlslEditorWidget::createAssistInterface(
}
//
// GlslEditor
//
class GlslEditor : public TextEditor::BaseTextEditor
{
public:
GlslEditor()
{
}
bool open(QString *errorString, const QString &fileName, const QString &realFileName)
{
textDocument()->setMimeType(Core::MimeDatabase::findByFile(QFileInfo(fileName)).type());
bool b = BaseTextEditor::open(errorString, fileName, realFileName);
return b;
}
};
//
// GlslEditorFactory
//
@@ -362,7 +341,6 @@ GlslEditorFactory::GlslEditorFactory()
setDocumentCreator([]() { return new BaseTextDocument(Constants::C_GLSLEDITOR_ID); });
setEditorWidgetCreator([]() { return new GlslEditorWidget; });
setEditorCreator([]() { return new GlslEditor; });
setIndenterCreator([]() { return new GlslIndenter; });
setSyntaxHighlighterCreator([]() { return new GlslHighlighter; });
setCommentStyle(Utils::CommentDefinition::CppStyle);