Skip to content

Commit

Permalink
Fix Routing settings default value
Browse files Browse the repository at this point in the history
Signed-off-by: Loren Eteval <[email protected]>
  • Loading branch information
LorenEteval committed Aug 17, 2023
1 parent 399120d commit 8ab40d3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Furious/Utility/Settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from Furious.Action.Language import SUPPORTED_LANGUAGE
from Furious.Action.Routing import BUILTIN_ROUTING
from Furious.Utility.Constants import SYSTEM_LANGUAGE
from Furious.Utility.Utility import Switch

Expand All @@ -22,7 +23,9 @@ def get(key):

value = QtCore.QSettings().value(settings.name)

if settings.protectedRange is None or value in settings.protectedRange:
if value is not None and (
settings.protectedRange is None or value in settings.protectedRange
):
return value

# Value not in protected range. Set to default
Expand Down Expand Up @@ -55,7 +58,7 @@ def set(key, value):
# Connected last time or not
Settings('Connect', Switch.RANGE),
# User Routing option
Settings('Routing'),
Settings('Routing', default=BUILTIN_ROUTING[0]),
# User Custom Routing object
Settings('CustomRouting'),
# User Configuration
Expand Down

0 comments on commit 8ab40d3

Please sign in to comment.