From bafd2fa25ab4b5e11ab30f2679a8df91caf027bf Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Wed, 20 Jan 2021 02:26:04 -0500 Subject: add menu item to clear image cache --- filecache.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'filecache.cpp') diff --git a/filecache.cpp b/filecache.cpp index 9f9f718..c0b2f36 100644 --- a/filecache.cpp +++ b/filecache.cpp @@ -17,6 +17,11 @@ Cache::~Cache() { fprintf(stderr, "error removing tmp dir\n"); } +void Cache::ClearCache() { + for (const auto &path : std::filesystem::directory_iterator(m_tmp_path)) + std::filesystem::remove_all(path); +} + std::string Cache::GetCachedName(std::string str) { uint32_t out; MurmurHash3_x86_32(str.c_str(), str.size(), 0, &out); -- cgit v1.2.3