aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Skec <skec@protonmail.ch>2021-01-06 20:22:52 +1100
committerFelix Queißner <felix@ib-queissner.de>2021-01-06 10:51:18 +0100
commitb7f07140cbe020a90f553cbd00fbcd9c35115579 (patch)
treed9b178ebcecf6b9bd694bc8079985a3646348420 /src
parent1f400782f7aa999fdd81bf25b315eb24c28530ff (diff)
downloadkristall-b7f07140cbe020a90f553cbd00fbcd9c35115579.tar.gz
Attempt to fix build failures
Also get rid of a warning
Diffstat (limited to 'src')
-rw-r--r--src/cachehandler.hpp19
-rw-r--r--src/protocols/abouthandler.cpp2
2 files changed, 20 insertions, 1 deletions
diff --git a/src/cachehandler.hpp b/src/cachehandler.hpp
index ca782bb..74f61a2 100644
--- a/src/cachehandler.hpp
+++ b/src/cachehandler.hpp
@@ -4,8 +4,27 @@
#include "mimeparser.hpp"
#include <memory>
#include <unordered_map>
+
#include <QUrl>
+#include <QString>
#include <QByteArray>
+#include <QtGlobal>
+
+// Need a QString hash implementation for Qt versions below 5.14
+#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+#include <QHash>
+namespace std
+{
+ template<>
+ struct hash<QString>
+ {
+ std::size_t operator()(const QString& s) const noexcept
+ {
+ return (size_t)qHash(s);
+ }
+ };
+}
+#endif
struct CachedPage
{
diff --git a/src/protocols/abouthandler.cpp b/src/protocols/abouthandler.cpp
index 784e1bb..8c90f5f 100644
--- a/src/protocols/abouthandler.cpp
+++ b/src/protocols/abouthandler.cpp
@@ -66,7 +66,7 @@ bool AboutHandler::startRequest(const QUrl &url, ProtocolHandler::RequestOptions
"In-memory cache usage:\n"
"* %1 used\n"
"* %2 pages in cache\n")
- .arg(IoUtil::size_human(cache_usage), QString::number(cached_count)));
+ .arg(IoUtil::size_human(cache_usage), QString::number(cached_count)).toUtf8());
emit this->requestComplete(document, "text/gemini");
}