Remove nested if statement

This commit is contained in:
kramo
2023-05-15 18:22:22 +02:00
parent 3127f4a898
commit 25a340015c

View File

@@ -312,13 +312,12 @@ class PreferencesWindow(Adw.PreferencesWindow):
)
def check_import(self, *_args):
if self.import_changed:
# This checks whether any of the switches that did actually change their state
# would have an effect on the outcome of the import action
# and if they would, it initiates it.
# This checks whether any of the switches that did actually change their state
# would have an effect on the outcome of the import action
# and if they would, it initiates it.
if any(
(value := widget.get_property(prop[0])) and value != prop[1]
for widget, prop in self.import_changed_widgets.items()
):
self.win.get_application().on_import_action()
if self.import_changed and any(
(value := widget.get_property(prop[0])) and value != prop[1]
for widget, prop in self.import_changed_widgets.items()
):
self.win.get_application().on_import_action()