From 598084b17a07706d766507d33970c29cf4d48b1e Mon Sep 17 00:00:00 2001 From: Laurent Monin Date: Thu, 7 Sep 2023 10:34:28 +0200 Subject: [PATCH] Make `_ca_providers()` a generator --- picard/ui/options/cover.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/picard/ui/options/cover.py b/picard/ui/options/cover.py index 9ffb25b5836..aabde134215 100644 --- a/picard/ui/options/cover.py +++ b/picard/ui/options/cover.py @@ -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()