From 9dd660d66e23f02716d4b2bad84ac86764de71a6 Mon Sep 17 00:00:00 2001 From: "Felix \"xq\" Queißner" Date: Sat, 20 Nov 2021 15:02:03 +0100 Subject: Improves caching api related to urls, implements fragment handling, fixes #237 --- src/cachehandler.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/cachehandler.hpp') diff --git a/src/cachehandler.hpp b/src/cachehandler.hpp index 0d20962..e744f92 100644 --- a/src/cachehandler.hpp +++ b/src/cachehandler.hpp @@ -45,7 +45,9 @@ struct CachedPage CachedPage(const QUrl &url, const QByteArray &body, const MimeType &mime, const QDateTime &cached) : url(url), body(body), mime(mime), scroll_pos(-1), time_cached(cached) - {} + { + this->url.setFragment(""); + } }; // Maybe unordered_map isn't the best type for this? @@ -67,12 +69,10 @@ public: CacheMap const& getPages() const; private: - std::shared_ptr find(QString const &url); - - bool contains(QString const & url); - void popOldest(); + static QString cleanUrl(QUrl const & str); + private: // In-memory cache storage. CacheMap page_cache; -- cgit v1.2.3