Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Fix deletion of image caused selection of the first image #742

Merged
merged 1 commit into from
Apr 28, 2021

Conversation

Also removed the call to self.import_dir_images method that reloaded all
of the images in directory.
Comment on lines +1431 to +1432
del self.m_img_list[self.cur_img_idx]
self.file_list_widget.takeItem(self.cur_img_idx)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing current image's path from the list of paths and from sidebar widget.

del self.m_img_list[self.cur_img_idx]
self.file_list_widget.takeItem(self.cur_img_idx)

self.cur_img_idx -= 1 # self.open_next_img will increment idx.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removal of a path caused left shift of all of the following paths and the next image's path has the same index as deleted one.
Decrementing because self.open_next_img will increment index later.

if os.path.exists(delete_path):
os.remove(delete_path)
self.import_dir_images(self.last_open_dir)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer required. Removed not to reload all of the paths and widget items.

@Ledorub Ledorub marked this pull request as ready for review April 28, 2021 13:48
@tzutalin tzutalin merged commit 4bf5c45 into HumanSignal:master Apr 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants