forked from qt-creator/qt-creator
Set correct mime type for C++ files.
This commit is contained in:
@@ -67,6 +67,7 @@
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
#include <utils/uncommentselection.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
@@ -1751,6 +1752,13 @@ const char *CPPEditorEditable::kind() const
|
||||
return CppEditor::Constants::CPPEDITOR_KIND;
|
||||
}
|
||||
|
||||
bool CPPEditorEditable::open(const QString & fileName)
|
||||
{
|
||||
bool b = TextEditor::BaseTextEditorEditable::open(fileName);
|
||||
editor()->setMimeType(Core::ICore::instance()->mimeDatabase()->findByFile(QFileInfo(fileName)).type());
|
||||
return b;
|
||||
}
|
||||
|
||||
void CPPEditor::setFontSettings(const TextEditor::FontSettings &fs)
|
||||
{
|
||||
TextEditor::BaseTextEditor::setFontSettings(fs);
|
||||
|
||||
Reference in New Issue
Block a user