diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-06-11 17:46:36 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-06-11 17:46:36 +0200 |
commit | 73c11f696ebfa27d0242b5e28486f8b5241a3a32 (patch) | |
tree | 691670bf2d0ff81b9df92b50bd6e99756303b45f /src | |
parent | c96fdcb4d639ae52ad1d2c812a07e5667849fe71 (diff) |
Cancel search when entering a new search term
Diffstat (limited to 'src')
-rw-r--r-- | src/QuickMedia.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 776f70f..046a9a2 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -2042,6 +2042,11 @@ namespace QuickMedia { idle_active_handler(); } + if(associated_data.search_text_updated && associated_data.fetch_status == FetchStatus::LOADING && associated_data.fetch_type == FetchType::SEARCH && associated_data.fetch_future.valid()) { + associated_data.fetch_future.cancel(); + associated_data.fetch_status = FetchStatus::NONE; + } + if(associated_data.search_text_updated && associated_data.fetch_status == FetchStatus::NONE && !associated_data.fetching_next_page_running) { std::string update_search_text = associated_data.update_search_text; associated_data.search_text_updated = false; |