From 3d2f92fe7df350909ff69ceca2072c21c2fd947d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Darrel=20Gri=C3=ABt?= Date: Sat, 21 Jun 2025 16:30:24 +0200 Subject: [PATCH] [bitwarden] Fix freeze when triggering bitwarden MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A freeze can be observed when triggering the bitwarden plugin. This seems to occur the second time `query.add` is called. To fix this issue the same logic as the `kill` plugin is used: Add all items to a local array before finally adding this using `query.add` This fixes https://github.com/albertlauncher/python/issues/215 Signed-off-by: Darrel Griƫt --- bitwarden/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bitwarden/__init__.py b/bitwarden/__init__.py index 3c8bf20e..87afe63a 100644 --- a/bitwarden/__init__.py +++ b/bitwarden/__init__.py @@ -68,8 +68,9 @@ def configWidget(self): ] def handleTriggerQuery(self, query): + results = [] if query.string.strip().lower() == "sync": - query.add( + results.append( StandardItem( id="sync", text="Sync Bitwarden Vault", @@ -85,7 +86,7 @@ def handleTriggerQuery(self, query): ) for p in self._filter_items(query): - query.add( + results.append( StandardItem( id=p["id"], text=p["path"], @@ -118,6 +119,8 @@ def handleTriggerQuery(self, query): ) ) + query.add(results) + def _get_items(self): not_first_time = self._cached_items is not None