Minor simplification of the autostart detection logic

This commit is contained in:
DevilXD committed 2024-07-17 13:41:00 +02:00
1 parent 07baba3935
commit db862cfdc0
1 file changed
+4 -6
+4 -6
View File
@@ -1714,13 +1714,11 @@ class SettingsPanel:
value_type, value = key.get(self.AUTOSTART_NAME) value_type, value = key.get(self.AUTOSTART_NAME)
except ValueNotFound: except ValueNotFound:
return False 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 # TODO: Consider deleting the old value to avoid autostart errors
return False return (
return True value_type is ValueType.REG_SZ
and self._get_self_path() in value
)
elif sys.platform == "linux": elif sys.platform == "linux":
autostart_file: Path = self._get_linux_autostart_filepath() autostart_file: Path = self._get_linux_autostart_filepath()
if not autostart_file.exists(): if not autostart_file.exists():