diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-04-02 00:21:03 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-04-02 00:21:03 +0200 |
commit | c2934be8485376571066a652e94ed16ba2bc8d81 (patch) | |
tree | 381e69b5b2ebdb42313fab7fa6978fcb966d580c /include/QuickMedia.hpp | |
parent | cfa37b674e9493388e7ebd89f53eacbb197cbdcb (diff) |
Cancel all tasks when pressing escape to go to previous page or when closing the window
Diffstat (limited to 'include/QuickMedia.hpp')
-rw-r--r-- | include/QuickMedia.hpp | 11 |
1 files changed, 6 insertions, 5 deletions
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 <vector> #include <memory> #include <SFML/Graphics/Font.hpp> @@ -65,8 +66,8 @@ namespace QuickMedia { bool fetching_next_page_running = false; int fetched_page = 0; sf::Text search_result_text; - std::future<FetchResult> fetch_future; - std::future<BodyItems> next_page_future; + AsyncTask<FetchResult> fetch_future; + AsyncTask<BodyItems> next_page_future; }; class Program { @@ -152,9 +153,9 @@ namespace QuickMedia { std::string manga_id_base64; Json::Value content_storage_json; std::unordered_set<std::string> watched_videos; - std::future<BodyItems> search_suggestion_future; - std::future<std::string> autocomplete_future; - std::future<void> image_download_future; + AsyncTask<BodyItems> search_suggestion_future; + AsyncTask<std::string> autocomplete_future; + AsyncTask<void> image_download_future; std::thread image_upscale_thead; MessageQueue<CopyOp> images_to_upscale_queue; std::vector<char> image_upscale_status; |