diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2020-06-22 21:10:04 +0200 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2020-06-22 21:10:04 +0200 |
| commit | 75ec461eeaa851cb5c53f4cfffc434e3e529ed1d (patch) | |
| tree | 3944737340718ca3675381aa06636045d397e780 /src/abouthandler.cpp | |
| parent | 8dbfb0890560fd1cd698d06fa05ac868c4db8576 (diff) | |
| download | kristall-75ec461eeaa851cb5c53f4cfffc434e3e529ed1d.tar.gz | |
Restructures the project source and cleans up a bit
Diffstat (limited to 'src/abouthandler.cpp')
| -rw-r--r-- | src/abouthandler.cpp | 61 |
1 files changed, 0 insertions, 61 deletions
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 <QUrl> -#include <QFile> - -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; -} |
