diff --git a/src/plugins/bineditor/bineditorplugin.cpp b/src/plugins/bineditor/bineditorplugin.cpp index c67c19574f9..7b5d5f8a743 100644 --- a/src/plugins/bineditor/bineditorplugin.cpp +++ b/src/plugins/bineditor/bineditorplugin.cpp @@ -222,8 +222,10 @@ public: bool open(QString *errorString, const QString &fileName, quint64 offset = 0) { QFile file(fileName); - if (offset >= static_cast(file.size())) + if (offset >= static_cast(file.size())) { + *errorString = tr("The Binary Editor can not open empty files."); return false; + } if (file.open(QIODevice::ReadOnly)) { file.close(); m_fileName = fileName; diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index cb190886973..2ebef075a65 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1173,9 +1173,10 @@ Core::Id EditorManager::getOpenWithEditorId(const QString &fileName, bool *isExternalEditor) const { // Collect editors that can open the file - const MimeType mt = ICore::mimeDatabase()->findByFile(fileName); + MimeType mt = ICore::mimeDatabase()->findByFile(fileName); + //Unable to determine mime type of fileName. Falling back to text/plain", if (!mt) - return Id(); + mt = ICore::mimeDatabase()->findByType(QLatin1String("text/plain")); QStringList allEditorIds; QStringList allEditorDisplayNames; QList externalEditorIds;