From 141c8bf5be37e109b1f89539b621bf341b0c7f7d Mon Sep 17 00:00:00 2001 From: Peter Sobolewski <76622105+psobolewskiPhD@users.noreply.github.com> Date: Thu, 9 Jan 2025 11:32:48 -0500 Subject: [PATCH] prevent double loading by having the tree model be a single source of truth --- src/napari_omero/widgets/main.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/napari_omero/widgets/main.py b/src/napari_omero/widgets/main.py index 8e66af3..6b44ff1 100644 --- a/src/napari_omero/widgets/main.py +++ b/src/napari_omero/widgets/main.py @@ -101,7 +101,6 @@ def _on_thumbnail_selected(self): index, QItemSelectionModel.ClearAndSelect | QItemSelectionModel.Rows, ) - self.load_image(wrapper) def _setup_tree(self): """Set up QTreeView with a fresh tree model.""" @@ -191,12 +190,6 @@ def _on_tree_selection(self, selected: QItemSelection, deselected: QItemSelectio self.thumb_grid.set_item(item) if item.isImage(): - # avoid loading the same image twice - if ( - self.thumb_grid.currentItem() - and self.thumb_grid.currentItem().wrapper == item.wrapper - ): - return QCoreApplication.processEvents() self.load_image(item.wrapper)