From b025204dfbf2e948cc3525e6cb8af36a02bdd30e Mon Sep 17 00:00:00 2001 From: Rebecca Breu Date: Fri, 29 Mar 2024 22:50:49 +0100 Subject: [PATCH] Fixed threading issue when importing images Don't deselect items from within the import worker thread. --- CHANGELOG.rst | 2 ++ beeref/commands.py | 3 ++- beeref/view.py | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 13a36b5..2b1a4a4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -25,6 +25,8 @@ Fixed * Removed black line under marching ants outline of crop mode, which would scale with the image and get potentially very thick. * Fixed a crash when importing images with unsupported exif orientation info +* Fixed threading issue when importing images (causing potential + hangs/weird behaviour) diff --git a/beeref/commands.py b/beeref/commands.py index 7c5c94a..6ffaa0e 100644 --- a/beeref/commands.py +++ b/beeref/commands.py @@ -26,10 +26,11 @@ class InsertItems(QtGui.QUndoCommand): self.ignore_first_redo = ignore_first_redo def redo(self): - self.scene.deselect_all_items() if self.ignore_first_redo: self.ignore_first_redo = False return + + self.scene.deselect_all_items() if self.position: self.old_positions = [] rect = self.scene.itemsBoundingRect(items=self.items) diff --git a/beeref/view.py b/beeref/view.py index 5366e61..62c8219 100644 --- a/beeref/view.py +++ b/beeref/view.py @@ -540,6 +540,7 @@ class BeeGraphicsView(MainControlsMixin, def do_insert_images(self, filenames, pos=None): if not pos: pos = self.get_view_center() + self.scene.deselect_all_items() self.undo_stack.beginMacro('Insert Images') self.worker = fileio.ThreadedIO( fileio.load_images,