diff options
| author | Karol Kosek <krkk@krkk.ct8.pl> | 2021-02-23 17:59:29 +0100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2021-02-23 18:55:26 +0100 |
| commit | c23988a2ec002042f9db0f8765524703662dcfe6 (patch) | |
| tree | 6e9fb5404316a437e7bdaf85ead2b92ecd93c9d3 /src/protocols | |
| parent | 291bfd02b4cda9c4d3fd25da01bbc539b9308a61 (diff) | |
| download | kristall-c23988a2ec002042f9db0f8765524703662dcfe6.tar.gz | |
GopherClient: add text-search support
Diffstat (limited to 'src/protocols')
| -rw-r--r-- | src/protocols/gopherclient.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/protocols/gopherclient.cpp b/src/protocols/gopherclient.cpp index 4af6605..6714611 100644 --- a/src/protocols/gopherclient.cpp +++ b/src/protocols/gopherclient.cpp @@ -50,6 +50,13 @@ bool GopherClient::startRequest(const QUrl &url, RequestOptions options) if(type == "") mime = "text/gophermap"; else if(type == "0") mime = "text/plain"; else if(type == "1") mime = "text/gophermap"; + else if(type == "7") { + mime = "text/gophermap"; + if (!url.hasQuery()) { + emit inputRequired(tr("Search:"), false); + return true; + } + } else if(type == "g") mime = "image/gif"; else if(type == "I") mime = "image/unknown"; else if(type == "h") mime = "text/html"; @@ -84,7 +91,8 @@ bool GopherClient::cancelRequest() void GopherClient::on_connected() { - auto blob = (requested_url.path().mid(2) + "\r\n").toUtf8(); + auto searchstr = requested_url.hasQuery() ? "\t" + requested_url.query() : QString(); + auto blob = (requested_url.path().mid(2) + searchstr + "\r\n").toUtf8(); IoUtil::writeAll(socket, blob); |
