forked from qt-creator/qt-creator
Utils: Allow mimetype deep-scan for remote files
Text editors need to know the actual mimetype of a file to be able to open the correct editor view. Just checking the extension is not enough. Especially on linux there are many text files without an extension. Change-Id: I7e5c935b0619f5d86e97f10bfd7ff9b65da62f4b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -732,7 +732,7 @@ Core::IDocument::OpenResult TextDocument::open(QString *errorString,
|
||||
emit aboutToOpen(filePath, realFilePath);
|
||||
OpenResult success = openImpl(errorString, filePath, realFilePath, /*reload =*/ false);
|
||||
if (success == OpenResult::Success) {
|
||||
setMimeType(Utils::mimeTypeForFile(filePath).name());
|
||||
setMimeType(Utils::mimeTypeForFile(filePath, MimeMatchMode::MatchDefaultAndRemote).name());
|
||||
emit openFinishedSuccessfully();
|
||||
}
|
||||
return success;
|
||||
|
||||
Reference in New Issue
Block a user