aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/AsyncImageLoader.hpp8
-rw-r--r--include/Body.hpp1
2 files changed, 6 insertions, 3 deletions
diff --git a/include/AsyncImageLoader.hpp b/include/AsyncImageLoader.hpp
index c1c2e11..5de9215 100644
--- a/include/AsyncImageLoader.hpp
+++ b/include/AsyncImageLoader.hpp
@@ -29,14 +29,18 @@ namespace QuickMedia {
class AsyncImageLoader {
public:
- AsyncImageLoader();
- ~AsyncImageLoader();
+ static AsyncImageLoader& get_instance();
// Returns false if the image loader is already loading an image. In that case, this function should be called again later.
// set |resize_target_size| to {0, 0} to disable resizing.
// |thumbnail_data.loading_state| has to be LoadingState::NOT_LOADED when calling this!
// Note: this method is not thread-safe
void load_thumbnail(const std::string &url, bool local, sf::Vector2i resize_target_size, bool use_tor, std::shared_ptr<ThumbnailData> thumbnail_data);
private:
+ AsyncImageLoader();
+ ~AsyncImageLoader();
+ AsyncImageLoader(AsyncImageLoader &other) = delete;
+ AsyncImageLoader& operator=(AsyncImageLoader &other) = delete;
+
struct ThumbnailLoadData {
Path path;
Path thumbnail_path;
diff --git a/include/Body.hpp b/include/Body.hpp
index 56ef262..4bfd36f 100644
--- a/include/Body.hpp
+++ b/include/Body.hpp
@@ -258,7 +258,6 @@ namespace QuickMedia {
private:
Program *program;
std::unordered_map<std::string, std::shared_ptr<ThumbnailData>> item_thumbnail_textures;
- AsyncImageLoader async_image_loader;
int selected_item;
int prev_selected_item;
float page_scroll;