diff options
author | Marcus Tillmanns <marcus.tillmanns@qt.io> | 2022-11-03 12:35:37 +0100 |
---|---|---|
committer | Marcus Tillmanns <marcus.tillmanns@qt.io> | 2022-11-04 09:52:15 +0000 |
commit | 7e0d545e64ebae123888873434daef293260d835 (patch) | |
tree | af44973734b3ee618c1e2da3fd3b05474d8d2818 /src/plugins/coreplugin/mainwindow.cpp | |
parent | 8de9892c4e877ea7b46940bfc25f203e789de994 (diff) |
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>
Diffstat (limited to 'src/plugins/coreplugin/mainwindow.cpp')
-rw-r--r-- | src/plugins/coreplugin/mainwindow.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index e71b0b1fc2..9c63e36e70 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -949,7 +949,8 @@ void MainWindow::openFile() static IDocumentFactory *findDocumentFactory(const QList<IDocumentFactory*> &fileFactories, const FilePath &filePath) { - const QString typeName = Utils::mimeTypeForFile(filePath).name(); + const QString typeName = Utils::mimeTypeForFile(filePath, MimeMatchMode::MatchDefaultAndRemote) + .name(); return Utils::findOrDefault(fileFactories, [typeName](IDocumentFactory *f) { return f->mimeTypes().contains(typeName); }); |