aboutsummaryrefslogtreecommitdiff
path: root/src/GlobalCache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/GlobalCache.cpp')
-rw-r--r--src/GlobalCache.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/GlobalCache.cpp b/src/GlobalCache.cpp
new file mode 100644
index 0000000..e627a33
--- /dev/null
+++ b/src/GlobalCache.cpp
@@ -0,0 +1,18 @@
+#include "../include/GlobalCache.hpp"
+#include "../include/GtkGif.hpp"
+
+namespace dchat
+{
+ static Cache *cache = nullptr;
+ Cache& getGlobalCache()
+ {
+ if(!cache)
+ {
+ cache = new Cache([](StringView fileContent)
+ {
+ return new GtkGif(fileContent);
+ });
+ }
+ return *cache;
+ }
+} \ No newline at end of file