diff options
| author | Mike Skec <skec@protonmail.ch> | 2020-12-30 19:29:52 +1100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2020-12-30 11:10:54 +0100 |
| commit | 80f64ff08cb3234c124cee786118c8e356942922 (patch) | |
| tree | f1e07e72630bad6f0ad0f02f3291eb9655e6676c /src/protocols | |
| parent | e5814f2bae65e9b757a26e8b263d5e868dbb2f41 (diff) | |
Revert "file:// protocol now supports text/gemini"
This reverts commit 01b5d9be0163a43e1d57d77820ce6c334b7f5d85.
Diffstat (limited to 'src/protocols')
| -rw-r--r-- | src/protocols/filehandler.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
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 <QMimeDatabase> #include <QUrl> #include <QFile> -#include <QFileInfo> #include <QDir> 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()) |
