aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-16 12:02:40 +0200
committerdec05eba <dec05eba@protonmail.com>2018-05-16 12:02:43 +0200
commit33f2c2b1d29731f890d3835032d911610e4fc69d (patch)
treecbf0cd857954d852022d97a68f3c8e3b4f9bbe46 /include
parente1dbec0b78671a4e90e578a2ab67b7b114d3b57b (diff)
Unload content if it's not visible on the screen for a while
Diffstat (limited to 'include')
-rw-r--r--include/Cache.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/Cache.hpp b/include/Cache.hpp
index 311658b..fc702a7 100644
--- a/include/Cache.hpp
+++ b/include/Cache.hpp
@@ -1,5 +1,6 @@
#pragma once
+#include "types.hpp"
#include <boost/filesystem/path.hpp>
#include <SFML/Graphics/Texture.hpp>
#include <string>
@@ -7,6 +8,7 @@
#include <thread>
#include <mutex>
#include <vector>
+#include <chrono>
namespace TinyProcessLib
{
@@ -50,6 +52,7 @@ namespace dchat
Type type;
CachedType cachedType;
+ i64 lastAccessed;
};
class Cache
@@ -79,6 +82,7 @@ namespace dchat
};
std::thread downloadWaitThread;
+ std::thread checkContentAccessTimeThread;
std::vector<ImageDownloadInfo> imageDownloadProcesses;
std::vector<ImageDownloadInfo> imageDownloadProcessesQueue;
std::mutex imageDownloadMutex;