Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Prevent double loading by having the tree model be a single source of truth #75

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/napari_omero/widgets/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -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)

Expand Down
Loading