Skip to content

Commit

Permalink
Avoid double loading (#64)
Browse files Browse the repository at this point in the history
* prevent loading image twice

* make sure that tree selection does something

* style(pre-commit.ci): auto fixes [...]

* Update pyproject.toml

Added myself and @psobolewskiPhD to authorlist

* Update pyproject.toml

Co-authored-by: Peter Sobolewski <[email protected]>

* Update pyproject.toml

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Peter Sobolewski <[email protected]>
  • Loading branch information
3 people authored Jan 7, 2025
1 parent 3e5be98 commit 1d53966
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/napari_omero/widgets/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ 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)

Expand Down

0 comments on commit 1d53966

Please sign in to comment.