From c2934be8485376571066a652e94ed16ba2bc8d81 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 2 Apr 2021 00:21:03 +0200 Subject: Cancel all tasks when pressing escape to go to previous page or when closing the window --- include/QuickMedia.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'include/QuickMedia.hpp') diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp index 3e8e7c7..497f202 100644 --- a/include/QuickMedia.hpp +++ b/include/QuickMedia.hpp @@ -6,6 +6,7 @@ #include "Storage.hpp" #include "Tab.hpp" #include "MessageQueue.hpp" +#include "AsyncTask.hpp" #include #include #include @@ -65,8 +66,8 @@ namespace QuickMedia { bool fetching_next_page_running = false; int fetched_page = 0; sf::Text search_result_text; - std::future fetch_future; - std::future next_page_future; + AsyncTask fetch_future; + AsyncTask next_page_future; }; class Program { @@ -152,9 +153,9 @@ namespace QuickMedia { std::string manga_id_base64; Json::Value content_storage_json; std::unordered_set watched_videos; - std::future search_suggestion_future; - std::future autocomplete_future; - std::future image_download_future; + AsyncTask search_suggestion_future; + AsyncTask autocomplete_future; + AsyncTask image_download_future; std::thread image_upscale_thead; MessageQueue images_to_upscale_queue; std::vector image_upscale_status; -- cgit v1.2.3