From a50b832de4019ce8b5d72e8541d64d68ed3a615a Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 10 Jul 2020 03:52:44 +0200 Subject: Make autocomplete asynchronous --- include/QuickMedia.hpp | 1 + include/SearchBar.hpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp index 8884c79..584903a 100644 --- a/include/QuickMedia.hpp +++ b/include/QuickMedia.hpp @@ -83,6 +83,7 @@ namespace QuickMedia { Json::Value content_storage_json; std::unordered_set watched_videos; std::future search_suggestion_future; + std::future autocomplete_future; std::future image_download_future; std::string downloading_chapter_url; bool image_download_cancel = false; diff --git a/include/SearchBar.hpp b/include/SearchBar.hpp index 0cffff5..6966466 100644 --- a/include/SearchBar.hpp +++ b/include/SearchBar.hpp @@ -12,7 +12,7 @@ namespace QuickMedia { // Return true to consume the search (clear the search field) using TextSubmitCallback = std::function; using TextBeginTypingCallback = std::function; - using AutocompleteRequestCallback = std::function; + using AutocompleteRequestCallback = std::function; class SearchBar { public: @@ -25,6 +25,7 @@ namespace QuickMedia { void append_text(const std::string &text_to_add); bool is_cursor_at_start_of_line() const; void set_to_autocomplete(); + void set_autocomplete_text(const std::string &text); float getBottom() const; float getBottomWithoutShadow() const; -- cgit v1.2.3