From 75ec461eeaa851cb5c53f4cfffc434e3e529ed1d Mon Sep 17 00:00:00 2001 From: "Felix (xq) Queißner" Date: Mon, 22 Jun 2020 21:10:04 +0200 Subject: Restructures the project source and cleans up a bit --- src/abouthandler.cpp | 61 ---------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 src/abouthandler.cpp (limited to 'src/abouthandler.cpp') diff --git a/src/abouthandler.cpp b/src/abouthandler.cpp deleted file mode 100644 index 01eefff..0000000 --- a/src/abouthandler.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "abouthandler.hpp" -#include "kristall.hpp" - -#include -#include - -AboutHandler::AboutHandler() -{ - -} - -bool AboutHandler::supportsScheme(const QString &scheme) const -{ - return (scheme == "about"); -} - -bool AboutHandler::startRequest(const QUrl &url, ProtocolHandler::RequestOptions options) -{ - Q_UNUSED(options) - if (url.path() == "blank") - { - emit this->requestComplete("", "text/gemini"); - } - else if (url.path() == "favourites") - { - QByteArray document; - - document.append("# Favourites\n"); - document.append("\n"); - - for (auto const &fav : global_favourites.getAll()) - { - document.append("=> " + fav.toString().toUtf8() + "\n"); - } - - this->requestComplete(document, "text/gemini"); - } - else - { - QFile file(QString(":/about/%1.gemini").arg(url.path())); - if (file.open(QFile::ReadOnly)) - { - emit this->requestComplete(file.readAll(), "text/gemini"); - } - else - { - emit this->networkError(ResourceNotFound, "The requested resource does not exist."); - } - } - return true; -} - -bool AboutHandler::isInProgress() const -{ - return false; -} - -bool AboutHandler::cancelRequest() -{ - return true; -} -- cgit v1.2.3