From e68f8ef8f45987ab0caa5a05d53980a3556547f3 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sat, 12 Sep 2020 03:17:34 -0400 Subject: make avatar loading a bit better --- imgmanager.hpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 imgmanager.hpp (limited to 'imgmanager.hpp') diff --git a/imgmanager.hpp b/imgmanager.hpp new file mode 100644 index 0000000..80262a8 --- /dev/null +++ b/imgmanager.hpp @@ -0,0 +1,17 @@ +#pragma once +#include +#include +#include +#include +#include "filecache.hpp" + +class ImageManager { +public: + Cache &GetCache(); + void LoadFromURL(std::string url, std::function)> cb); + Glib::RefPtr GetFromURLIfCached(std::string url); + +private: + std::unordered_map> m_pixs; + Cache m_cache; +}; -- cgit v1.2.3