From db862cfdc08146e76d019f79237c894c9b862311 Mon Sep 17 00:00:00 2001 From: DevilXD <4180725+DevilXD@users.noreply.github.com> Date: Wed, 17 Jul 2024 13:41:00 +0200 Subject: [PATCH] Minor simplification of the autostart detection logic --- gui.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/gui.py b/gui.py index c0e38fb..22d13d4 100644 --- a/gui.py +++ b/gui.py @@ -1714,13 +1714,11 @@ class SettingsPanel: value_type, value = key.get(self.AUTOSTART_NAME) except ValueNotFound: return False - if ( - value_type is not ValueType.REG_SZ - or self._get_self_path() not in value - ): - # TODO: Consider deleting the old value to avoid autostart errors - return False - return True + # TODO: Consider deleting the old value to avoid autostart errors + return ( + value_type is ValueType.REG_SZ + and self._get_self_path() in value + ) elif sys.platform == "linux": autostart_file: Path = self._get_linux_autostart_filepath() if not autostart_file.exists():