Skip to content

Commit

Permalink
Make _ca_providers() a generator
Browse files Browse the repository at this point in the history
  • Loading branch information
zas committed Sep 7, 2023
1 parent 6a196de commit 5e64ed0
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
Expand Up @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit 5e64ed0

Please sign in to comment.