From 25a340015c1a3c931cf9f192c469d1672510fae9 Mon Sep 17 00:00:00 2001 From: kramo <93832451+kra-mo@users.noreply.github.com> Date: Mon, 15 May 2023 18:22:22 +0200 Subject: [PATCH] Remove nested if statement --- src/preferences.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/preferences.py b/src/preferences.py index dff11bd..b348fa5 100644 --- a/src/preferences.py +++ b/src/preferences.py @@ -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()