Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make _ca_providers() a generator
Browse files Browse the repository at this point in the history
zas committed Sep 7, 2023
1 parent 6aac5a9 commit 598084b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions picard/ui/options/cover.py
Original file line number Diff line number Diff line change
@@ -107,11 +107,9 @@ def load(self):
self.update_ca_providers_groupbox_state()

def _ca_providers(self):
items = []
for i in range(self.ui.ca_providers_list.count()):
item = self.ui.ca_providers_list.item(i)
items.append((item.data, item.checked))
return items
yield (item.data, item.checked)

def save(self):
config = get_config()
@@ -122,7 +120,7 @@ def save(self):
config.setting["save_images_overwrite"] = self.ui.save_images_overwrite.isChecked()
config.setting["save_only_one_front_image"] = self.ui.save_only_one_front_image.isChecked()
config.setting["image_type_as_filename"] = self.ui.image_type_as_filename.isChecked()
config.setting["ca_providers"] = self._ca_providers()
config.setting["ca_providers"] = list(self._ca_providers())

def update_ca_providers_groupbox_state(self):
files_enabled = self.ui.save_images_to_files.isChecked()

0 comments on commit 598084b

Please sign in to comment.