From b3ce9ada8c2e888545a61ce27f6405f57f37d229 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Tue, 21 Dec 2021 17:25:06 -0500 Subject: [PATCH] add placeholder for refreshing model from cache4 --- examples/dock/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/dock/main.rs b/examples/dock/main.rs index 11167be7..c32211cb 100644 --- a/examples/dock/main.rs +++ b/examples/dock/main.rs @@ -34,6 +34,7 @@ static X11_CONN: OnceCell = OnceCell::new(); pub enum Event { Response(pop_launcher::Response), + RefreshFromCache, Search(String), Activate(u32), } @@ -126,6 +127,9 @@ fn main() { Event::Activate(index) => { let _ = launcher.send(pop_launcher::Request::Activate(index)).await; } + Event::RefreshFromCache => { + //TODO refresh the model from cached_results (required after DnD for example) + } Event::Response(event) => { if let pop_launcher::Response::Update(mut results) = event { // sort to make comparison with cache easier @@ -151,6 +155,7 @@ fn main() { acc }); let mut stack_active: Vec = stack_active.into_values().collect(); + // update active app stacks for saved apps into the saved app model // then put the rest in the active app model (which doesn't include saved apps) let saved_app_model = window.saved_app_model();