From 80f64ff08cb3234c124cee786118c8e356942922 Mon Sep 17 00:00:00 2001 From: Mike Skec Date: Wed, 30 Dec 2020 19:29:52 +1100 Subject: Revert "file:// protocol now supports text/gemini" This reverts commit 01b5d9be0163a43e1d57d77820ce6c334b7f5d85. --- src/protocols/filehandler.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'src/protocols') diff --git a/src/protocols/filehandler.cpp b/src/protocols/filehandler.cpp index c53b3e1..dfb6243 100644 --- a/src/protocols/filehandler.cpp +++ b/src/protocols/filehandler.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include FileHandler::FileHandler() @@ -26,22 +25,9 @@ bool FileHandler::startRequest(const QUrl &url, RequestOptions options) if (file.open(QFile::ReadOnly)) { + QMimeDatabase db; + auto mime = db.mimeTypeForUrl(url).name(); auto data = file.readAll(); - QString mime; - - // Find mime type of file. We detect text/gemini - // using the file suffix. - QString suffix = QFileInfo(file).completeSuffix(); - if (suffix == "gmi") - { - mime = "text/gemini"; - } - else - { - QMimeDatabase db; - mime = db.mimeTypeForUrl(url).name(); - } - emit this->requestComplete(data, mime); } else if (QDir dir = QDir(url.path()); dir.exists()) -- cgit v1.2.3