forked from qt-creator/qt-creator
CppEditor: Don't try to set mimetype when opening failed
Change-Id: Ie0823acc3dfd216c3f22a93ee39d9919bf95c0a9 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -1876,10 +1876,11 @@ Core::Id CPPEditor::id() const
|
||||
|
||||
bool CPPEditor::open(QString *errorString, const QString &fileName, const QString &realFileName)
|
||||
{
|
||||
bool b = TextEditor::BaseTextEditor::open(errorString, fileName, realFileName);
|
||||
if (!TextEditor::BaseTextEditor::open(errorString, fileName, realFileName))
|
||||
return false;
|
||||
editorWidget()->setMimeType(
|
||||
Core::ICore::mimeDatabase()->findByFile(QFileInfo(fileName)).type());
|
||||
return b;
|
||||
return true;
|
||||
}
|
||||
|
||||
const Utils::CommentDefinition *CPPEditor::commentDefinition() const
|
||||
|
||||
Reference in New Issue
Block a user